[Pkg-javascript-commits] [sockjs-client] 142/434: cosmetic.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:09 UTC 2014


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

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

commit 2d41835447350c4c65db739e84c233c3267f4661
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Fri Sep 9 14:21:27 2011 +0100

    cosmetic.
---
 README.md     | 4 +++-
 lib/sockjs.js | 6 +++---
 lib/utils.js  | 6 +++---
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index febcb47..c00b27e 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,9 @@ Philosophy:
    [to wait for 3 seconds](https://github.com/gimite/web-socket-js/issues/49)
    in order to detect problems)
  * Connection establishment should be fast and lightweight.
- * The API should follow [HTML5 Websockets API](http://dev.w3.org/html5/websockets/) as closely as possible (but we're not there yet).
+ * The API should follow
+   [HTML5 Websockets API](http://dev.w3.org/html5/websockets/) as
+   closely as possible (but we're not there yet).
 
 
 Subscribe to
diff --git a/lib/sockjs.js b/lib/sockjs.js
index bd88a14..1f33fa5 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -98,9 +98,9 @@ SockJS.prototype._didClose = function(status, reason) {
     }
     that.readyState = SockJS.CLOSED;
 
-    setTimeout(function() {
+    utils.delay(function() {
                    that.dispatchEvent(close_event);
-               }, 0);
+                });
 };
 
 SockJS.prototype._didMessage = function(data) {
@@ -165,7 +165,7 @@ SockJS.prototype._try_next_protocol = function(close_event) {
         } else {
             that._debug('Opening transport:', protocol);
             that._transport = new SockJS[protocol](that, that._trans_url,
-                                                        that._base_url);
+                                                         that._base_url);
             return true;
         }
     }
diff --git a/lib/utils.js b/lib/utils.js
index babab6d..15144a1 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -162,9 +162,9 @@ utils.createXHR = function(method, url, payload, callback) {
     }
 
     var cleanup = function() {
-        // IE needs this field to be a function
         if (xhr) {
-            try{
+            // IE needs this field to be a function
+            try {
                 xhr.onreadystatechange = null;
             } catch (x) {
                 xhr.onreadystatechange = function(){};
@@ -347,5 +347,5 @@ utils.delay = function(t, fun) {
         fun = t;
         t = 0;
     }
-    setTimeout(fun, t);
+    return setTimeout(fun, t);
 };
\ No newline at end of file

-- 
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