Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
fix readystate event handler invocation
  • Loading branch information
pmuellr committed Sep 4, 2014
1 parent d1694e4 commit 34d2980aea58ddc0d62ddb3924b6c649aca03f4c
Showing 1 changed file with 2 additions and 3 deletions.
@@ -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

0 comments on commit 34d2980

Please sign in to comment.