You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/07/02 13:48:27 UTC

[GitHub] jcesarmobile closed pull request #8: Fix critical error in target device javascript

jcesarmobile closed pull request #8: Fix critical error in target device javascript
URL: https://github.com/apache/cordova-weinre/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/weinre.web/modules/weinre/common/WebSocketXhr.coffee b/weinre.web/modules/weinre/common/WebSocketXhr.coffee
index 6e10488..49f0811 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.bind(xhr)
 
         HookLib.ignoreHooks ->
             xhr.open method, url, true
@@ -213,7 +213,7 @@ module.exports = class WebSocketXhr
 
 #-------------------------------------------------------------------------------
 _xhrEventHandler = (event) ->
-      xhr = event.target
+      xhr = this
       return unless xhr.readyState == 4
 
       xhr.httpSocketHandler.call xhr.httpSocket, xhr


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org