[Pkg-javascript-commits] [sockjs-client] 84/350: Fix errors

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:45 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 e0eb2ec050e2ea6d032c89b3bbc5329bd9d24475
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Mon Aug 25 00:36:53 2014 -0400

    Fix errors
---
 lib/sockjs.js                   | 5 ++++-
 lib/utils.js                    | 2 +-
 tests/html/lib/domtests.js      | 2 +-
 tests/html/lib/endtoendtests.js | 4 ++--
 tests/html/lib/tests.js         | 4 ++--
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/sockjs.js b/lib/sockjs.js
index f48370b..62da157 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -21,7 +21,7 @@ var XDRObject = require('./xdr');
 var XDRPolling = require('./trans-xdr-polling');
 var IframeTransport = require('./trans-iframe');
 
-var protocols = require('./protocols')
+var protocols = require('./protocols');
 
 function SockJS(url, _reserved, options) {
     if (!(this instanceof SockJS)) {
@@ -329,6 +329,9 @@ FacadeJS['w-iframe-eventsource'] = require('./trans-eventsource');
 FacadeJS['w-iframe-htmlfile'] = require('./trans-htmlfile');
 FacadeJS['w-iframe-xhr-polling'] = require('./xhr-polling-iframe');
 
+// This is seriously wack. It is needed for almost all iframe transports
+if ('_sockjs_onload' in window) setTimeout(window._sockjs_onload, 1);
+
 function createInfoReceiver(base_url) {
     if (utils.isSameOriginUrl(base_url)) {
         // If, for some reason, we have SockJS locally - there's no
diff --git a/lib/utils.js b/lib/utils.js
index aef8451..5631950 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -389,7 +389,7 @@ utils.unload_add = function(listener) {
     var ref = utils.random_string(8);
     on_unload[ref] = listener;
     if (after_unload) {
-        utils.delay(trigger_unload_callbacks);
+        setTimeout(trigger_unload_callbacks, 0);
     }
     return ref;
 };
diff --git a/tests/html/lib/domtests.js b/tests/html/lib/domtests.js
index 120d4e1..9534d3a 100644
--- a/tests/html/lib/domtests.js
+++ b/tests/html/lib/domtests.js
@@ -85,7 +85,7 @@ if (!require('../../../lib/trans-iframe').enabled()) {
                 window.attachEvent('on' + event, listener);\n\
             }\n\
         }\n\
-        attachMessage(function(e) {\n\
+        attachEvent('message', function(e) {\n\
             var b = e.data;\n\
             parent.postMessage(window_id + ' ' + 'e', '*');\n\
         });\n\
diff --git a/tests/html/lib/endtoendtests.js b/tests/html/lib/endtoendtests.js
index 95caca0..af1eccd 100644
--- a/tests/html/lib/endtoendtests.js
+++ b/tests/html/lib/endtoendtests.js
@@ -101,8 +101,8 @@ test("close on close", function(done) {
       assert.ok(false);
     };
     r.close();
-    u.delay(10, function() {
+    setTimeout(function() {
       done();
-    });
+    }, 10);
   };
 });
diff --git a/tests/html/lib/tests.js b/tests/html/lib/tests.js
index ac3f0c6..8492667 100644
--- a/tests/html/lib/tests.js
+++ b/tests/html/lib/tests.js
@@ -1,11 +1,11 @@
 'use strict';
-/* global suite, test, SockJS, client_opts */
+/* global suite, test, client_opts */
 var arrIndexOf, batch_factory_factory, batch_factory_factory_amp, echo_factory_factory, escapable, factor_batch_large, factor_batch_large_amp, factor_echo_basic, factor_echo_from_child, factor_echo_large_message, factor_echo_rich, factor_echo_special_chars, factor_echo_unicode, factor_echo_utf_encoding, factor_echo_utf_encoding_simple, factor_server_close, factor_user_close, generate_killer_string, test_protocol_messages;
 
 var assert = require('assert');
 var u = require('../../../lib/utils');
 var testutils = require('./testutils');
-var protocols = require('../../../lib/protocols')
+var protocols = require('../../../lib/protocols');
 
 var TIMEOUT_MS = 10000;
 

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