You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pm...@apache.org on 2014/08/30 22:07:07 UTC
weinre commit: fix readystate event handler invocation
Repository: cordova-weinre
Updated Branches:
refs/heads/CB-7437 [created] f6c24acb6
fix readystate event handler invocation
Project: http://git-wip-us.apache.org/repos/asf/cordova-weinre/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-weinre/commit/f6c24acb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-weinre/tree/f6c24acb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-weinre/diff/f6c24acb
Branch: refs/heads/CB-7437
Commit: f6c24acb6c897de9ab2c68af41e92d8c54b5717c
Parents: feb2f06
Author: Patrick Mueller <pm...@apache.org>
Authored: Sat Aug 30 16:06:52 2014 -0400
Committer: Patrick Mueller <pm...@apache.org>
Committed: Sat Aug 30 16:06:52 2014 -0400
----------------------------------------------------------------------
weinre.web/modules/weinre/common/WebSocketXhr.coffee | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/f6c24acb/weinre.web/modules/weinre/common/WebSocketXhr.coffee
----------------------------------------------------------------------
diff --git a/weinre.web/modules/weinre/common/WebSocketXhr.coffee b/weinre.web/modules/weinre/common/WebSocketXhr.coffee
index 6e10488..456ba91 100644
--- a/weinre.web/modules/weinre/common/WebSocketXhr.coffee
+++ b/weinre.web/modules/weinre/common/WebSocketXhr.coffee
@@ -201,7 +201,7 @@ module.exports = class WebSocketXhr
xhr = (if XMLHttpRequest.noConflict then new XMLHttpRequest.noConflict() else new XMLHttpRequest())
xhr.httpSocket = this
xhr.httpSocketHandler = handler
- xhr.onreadystatechange = _xhrEventHandler
+ xhr.onreadystatechange = -> _xhrEventHandler xhr
HookLib.ignoreHooks ->
xhr.open method, url, true
@@ -212,8 +212,7 @@ module.exports = class WebSocketXhr
xhr.send data
#-------------------------------------------------------------------------------
-_xhrEventHandler = (event) ->
- xhr = event.target
+_xhrEventHandler = (xhr) ->
return unless xhr.readyState == 4
xhr.httpSocketHandler.call xhr.httpSocket, xhr