[Pkg-javascript-commits] [sockjs-client] 129/350: Emit error event when appropriate

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit b30895f21e48e298da292578e3bed7b3565cbf39
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Mon Oct 13 11:55:59 2014 -0400

    Emit error event when appropriate
---
 lib/main.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/main.js b/lib/main.js
index 2f3f665..4ad023c 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -275,7 +275,9 @@ SockJS.prototype._close = function(code, reason, wasClean) {
   process.nextTick(function () {
     this.readyState = SockJS.CLOSED;
 
-    // TODO if required to fail the connection, fire error event
+    if (forceFail) {
+      this.dispatchEvent(new Event().initEvent('error'));
+    }
 
     var e = new CloseEvent();
     e.wasClean = wasClean;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list