[Pkg-javascript-commits] [sockjs-client] 55/350: Remove coffeescriptisms
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:03:41 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 5df0dab76876053cdad7c2b4875a2f27fc56f1d6
Author: Bryce Kahle <bkahle at gmail.com>
Date: Tue May 27 17:13:52 2014 -0400
Remove coffeescriptisms
---
lib/sockjs.js | 4 ---
lib/utils.js | 46 +++++++++++++--------------
tests/html/lib/domtests.js | 50 ++++++++++++++---------------
tests/html/lib/endtoendtests.js | 54 +++++++++++++++----------------
tests/html/lib/tests.js | 70 +++++++++++++++++++----------------------
tests/html/lib/unittests.js | 41 ++++++++++--------------
6 files changed, 124 insertions(+), 141 deletions(-)
diff --git a/lib/sockjs.js b/lib/sockjs.js
index 4736287..d3a4c22 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -336,10 +336,6 @@ SockJS.bootstrap_iframe = function() {
}
};
- // alert('test ticker');
- // facade = new FacadeJS();
- // facade._transport = new FacadeJS['w-iframe-xhr-polling'](facade, 'http://host.com:9999/ticker/12/basd');
-
utils.attachMessage(onMessage);
// Start
diff --git a/lib/utils.js b/lib/utils.js
index 90dc4a1..cd2739e 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -10,32 +10,33 @@
var JSON3 = require('json3');
var utils = {};
-// This string has length 32, a power of 2, so the modulus doesn't introduce a
-// bias.
-var random_string_chars = 'abcdefghijklmnopqrstuvwxyz012345';
-// Use real randomness when available.
-if (window.crypto && window.crypto.getRandomValues) {
- utils.random_string = function(length) {
- var max = random_string_chars.length;
- var ret = [];
+var getRandomBytes;
+if (window && window.crypto && window.crypto.getRandomValues) {
+ getRandomBytes = function (length) {
var bytes = new Uint8Array(length);
-
window.crypto.getRandomValues(bytes);
- for(var i=0; i < length; i++) {
- ret.push( random_string_chars[bytes[i] % max] );
- }
- return ret.join('');
+ return bytes;
};
} else {
- utils.random_string = function(length) {
- var max = random_string_chars.length;
- var ret = [];
- for(var i=0; i < length; i++) {
- ret.push( random_string_chars[Math.floor(Math.random() * max)] );
- }
- return ret.join('');
+ getRandomBytes = function (length) {
+ var bytes = new Uint8Array(length);
+ for (var i=0; i < length; i++) bytes[i] = Math.floor(Math.random() * 256);
+ return bytes;
};
}
+
+// This string has length 32, a power of 2, so the modulus doesn't introduce a
+// bias.
+var random_string_chars = 'abcdefghijklmnopqrstuvwxyz012345';
+utils.random_string = function(length) {
+ var max = random_string_chars.length;
+ var bytes = getRandomBytes(length);
+ var ret = [];
+ for (var i=0; i < length; i++) {
+ ret.push( random_string_chars[bytes[i] % max] );
+ }
+ return ret.join('');
+};
utils.random_number = function(max) {
return Math.floor(Math.random() * max);
};
@@ -55,10 +56,7 @@ utils.getOrigin = function(url) {
utils.isSameOriginUrl = function(url_a, url_b) {
// location.origin would do, but it's not always available.
if (!url_b) url_b = window.location.href;
-
- return (url_a.split('/').slice(0,3).join('/')
- ===
- url_b.split('/').slice(0,3).join('/'));
+ return utils.getOrigin(url_a) === utils.getOrigin(url_b);
};
utils.isSameOriginScheme = function(url_a, url_b) {
diff --git a/tests/html/lib/domtests.js b/tests/html/lib/domtests.js
index 3106931..cce7270 100644
--- a/tests/html/lib/domtests.js
+++ b/tests/html/lib/domtests.js
@@ -24,17 +24,17 @@ onunload_test_factory = function(code) {
};
return setTimeout(f, 1);
};
- return hook.unload = function() {
+ hook.unload = function() {
ok(true, 'onunload hook called by an iframe');
hook.del();
- return start();
+ start();
};
};
};
if (navigator.userAgent.indexOf('Konqueror') !== -1 || navigator.userAgent.indexOf('Opera') !== -1) {
test("onunload [unsupported by client]", function() {
- return ok(true);
+ ok(true);
});
} else {
asyncTest('onunload', onunload_test_factory("var u = SockJS.getUtils();\nu.attachEvent('load', function(){\n hook.load();\n});\nvar w = 0;\nvar run = function(){\n if(w === 0) {\n w = 1;\n hook.unload();\n }\n};\nu.attachEvent('beforeunload', run);\nu.attachEvent('unload', run);"));
@@ -42,7 +42,7 @@ if (navigator.userAgent.indexOf('Konqueror') !== -1 || navigator.userAgent.index
if (!require('../../../lib/trans-iframe').enabled()) {
test("onmessage [unsupported by client]", function() {
- return ok(true);
+ ok(true);
});
} else {
asyncTest('onmessage', function() {
@@ -51,9 +51,9 @@ if (!require('../../../lib/trans-iframe').enabled()) {
hook = testutils.newIframe();
hook.open = function() {
ok(true, 'open hook called by an iframe');
- return hook.callback("var u = SockJS.getUtils();\nu.attachMessage(function(e) {\n var b = e.data;\n parent.postMessage(window_id + ' ' + 'e', '*');\n});\nparent.postMessage(window_id + ' ' + 's', '*');");
+ hook.callback("var u = SockJS.getUtils();\nu.attachMessage(function(e) {\n var b = e.data;\n parent.postMessage(window_id + ' ' + 'e', '*');\n});\nparent.postMessage(window_id + ' ' + 's', '*');");
};
- return u.attachMessage(function(e) {
+ u.attachMessage(function(e) {
var data, origin, window_id, _ref;
_ref = e.data.split(' '), window_id = _ref[0], data = _ref[1];
if (window_id === hook.id) {
@@ -62,12 +62,14 @@ if (!require('../../../lib/trans-iframe').enabled()) {
hook.iobj.loaded();
ok(true, 'start frame send');
origin = u.getOrigin(u.amendUrl('/'));
- return hook.iobj.post(hook.id + ' ' + 's', origin);
+ hook.iobj.post(hook.id + ' ' + 's', origin);
+ break;
case 'e':
ok(true, 'done hook called by an iframe');
hook.iobj.cleanup();
hook.del();
- return start();
+ start();
+ break;
}
}
});
@@ -75,32 +77,32 @@ if (!require('../../../lib/trans-iframe').enabled()) {
}
ajax_simple_factory = function(name, Obj) {
- return asyncTest(name + ' simple', function() {
+ asyncTest(name + ' simple', function() {
var x;
expect(2);
x = new Obj('GET', '/simple.txt', null);
- return x.onfinish = function(status, text) {
+ x.onfinish = function(status, text) {
equal(text.length, 2051);
equal(text.slice(-2), 'b\n');
- return start();
+ start();
};
});
};
ajax_streaming_factory = function(name, Obj) {
- return asyncTest(name + ' streaming', function() {
+ asyncTest(name + ' streaming', function() {
var x;
expect(4);
x = new Obj('GET', '/streaming.txt', null);
x.onchunk = function(status, text) {
equal(status, 200);
ok(text.length <= 2049, 'Most likely you\'re behind a transparent Proxy that can\'t do streaming. QUnit tests won\'t work properly. Sorry!');
- return delete x.onchunk;
+ delete x.onchunk;
};
return x.onfinish = function(status, text) {
equal(status, 200);
equal(text.slice(-4), 'a\nb\n');
- return start();
+ start();
};
});
};
@@ -113,26 +115,24 @@ test_wrong_url = function(name, Obj, url, statuses) {
expect(2);
x = new Obj('GET', url, null);
x.onchunk = function() {
- return ok(false, "chunk shall not be received");
+ ok(false, "chunk shall not be received");
};
- return x.onfinish = function(status, text) {
+ x.onfinish = function(status, text) {
ok(u.arrIndexOf(statuses, status) !== -1);
equal(text, '');
- return start();
+ start();
};
};
ajax_wrong_port_factory = function(name, Obj) {
- var port, _i, _len, _ref, _results;
+ var port, _i, _len, _ref;
_ref = [25, 8999, 65300];
- _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
port = _ref[_i];
- _results.push(asyncTest(name + ' wrong port ' + port, function() {
- return test_wrong_url(name, Obj, 'http://localhost:' + port + '/wrong_url_indeed.txt', [0]);
- }));
+ asyncTest(name + ' wrong port ' + port, function() {
+ test_wrong_url(name, Obj, 'http://localhost:' + port + '/wrong_url_indeed.txt', [0]);
+ });
}
- return _results;
};
var XHRLocalObject = require('../../../lib/xhr-local');
@@ -151,11 +151,11 @@ ajax_wrong_port_factory('XHRLocalObject', XHRLocalObject);
if (window.XDomainRequest) ajax_wrong_port_factory('XDRObject', XDRObject);
asyncTest('XHRLocalObject wrong url', function() {
- return test_wrong_url('XHRLocalObject', XHRLocalObject, '/wrong_url_indeed.txt', [0, 404]);
+ test_wrong_url('XHRLocalObject', XHRLocalObject, '/wrong_url_indeed.txt', [0, 404]);
});
if (window.XDomainRequest) {
asyncTest('XDRObject wrong url', function() {
- return test_wrong_url('XDRObject', XDRObject, '/wrong_url_indeed.txt', [0]);
+ test_wrong_url('XDRObject', XDRObject, '/wrong_url_indeed.txt', [0]);
});
}
diff --git a/tests/html/lib/endtoendtests.js b/tests/html/lib/endtoendtests.js
index 91b40e5..213bca7 100644
--- a/tests/html/lib/endtoendtests.js
+++ b/tests/html/lib/endtoendtests.js
@@ -11,11 +11,11 @@ factory_body_check = function(protocol) {
var n;
if (!SockJS[protocol] || !SockJS[protocol].enabled(client_opts.sockjs_opts)) {
n = " " + protocol + " [unsupported by client]";
- return test(n, function() {
- return u.log('Unsupported protocol (by client): "' + protocol + '"');
+ test(n, function() {
+ u.log('Unsupported protocol (by client): "' + protocol + '"');
});
} else {
- return asyncTest(protocol, function() {
+ asyncTest(protocol, function() {
var code, hook, url;
expect(5);
url = client_opts.url + '/echo';
@@ -24,21 +24,21 @@ factory_body_check = function(protocol) {
hook.open = function() {
hook.iobj.loaded();
ok(true, 'open');
- return hook.callback(code);
+ hook.callback(code);
};
hook.test_body = function(is_body, type) {
- return equal(is_body, false, 'body not yet loaded ' + type);
+ equal(is_body, false, 'body not yet loaded ' + type);
};
hook.onopen = function() {
ok(true, 'onopen');
return 'a';
};
- return hook.onmessage = function(m) {
+ hook.onmessage = function(m) {
equal(m, 'a');
ok(true, 'onmessage');
hook.iobj.cleanup();
hook.del();
- return start();
+ start();
};
});
}
@@ -52,12 +52,12 @@ asyncTest("invalid url 404", function() {
r = testutils.newSockJS('/invalid_url', 'jsonp-polling');
ok(r);
r.onopen = function(e) {
- return ok(false);
+ ok(false);
};
r.onmessage = function(e) {
- return ok(false);
+ ok(false);
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
if (u.isXHRCorsCapable() < 4) {
equal(e.code, 1002);
equal(e.reason, 'Can\'t connect to server');
@@ -66,7 +66,7 @@ asyncTest("invalid url 404", function() {
equal(e.reason, 'All transports failed');
}
equal(e.wasClean, false);
- return start();
+ start();
};
});
@@ -77,9 +77,9 @@ asyncTest("invalid url port", function() {
r = testutils.newSockJS(dl.protocol + '//' + dl.hostname + ':1079', 'jsonp-polling');
ok(r);
r.onopen = function(e) {
- return ok(false);
+ ok(false);
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
if (u.isXHRCorsCapable() < 4) {
equal(e.code, 1002);
equal(e.reason, 'Can\'t connect to server');
@@ -88,7 +88,7 @@ asyncTest("invalid url port", function() {
equal(e.reason, 'All transports failed');
}
equal(e.wasClean, false);
- return start();
+ start();
};
});
@@ -97,16 +97,16 @@ asyncTest("disabled websocket test", function() {
expect(3);
r = testutils.newSockJS('/disabled_websocket_echo', 'websocket');
r.onopen = function(e) {
- return ok(false);
+ ok(false);
};
r.onmessage = function(e) {
- return ok(false);
+ ok(false);
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
equal(e.code, 2000);
equal(e.reason, "All transports failed");
equal(e.wasClean, false);
- return start();
+ start();
};
});
@@ -115,21 +115,21 @@ asyncTest("close on close", function() {
expect(4);
r = testutils.newSockJS('/close', 'jsonp-polling');
r.onopen = function(e) {
- return ok(true);
+ ok(true);
};
r.onmessage = function(e) {
- return ok(false);
+ ok(false);
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
equal(e.code, 3000);
equal(e.reason, "Go away!");
equal(e.wasClean, true);
r.onclose = function() {
- return ok(false);
+ ok(false);
};
r.close();
- return u.delay(10, function() {
- return start();
+ u.delay(10, function() {
+ start();
});
};
});
@@ -142,12 +142,12 @@ asyncTest("EventEmitter exception handling", function() {
window.onerror = function(e) {
ok(/onopen error/.test('' + e));
window.onerror = prev_onerror;
- return r.close();
+ r.close();
};
r.onopen = function(e) {
throw "onopen error";
};
- return r.onclose = function() {
- return start();
+ r.onclose = function() {
+ start();
};
});
diff --git a/tests/html/lib/tests.js b/tests/html/lib/tests.js
index 98f46d1..dcae965 100644
--- a/tests/html/lib/tests.js
+++ b/tests/html/lib/tests.js
@@ -13,7 +13,7 @@ echo_factory_factory = function(protocol, messages) {
r = testutils.newSockJS('/echo', protocol);
r.onopen = function(e) {
ok(true);
- return r.send(a[0]);
+ r.send(a[0]);
};
r.onmessage = function(e) {
var i, x, xx1, xx2, _ref;
@@ -31,18 +31,18 @@ echo_factory_factory = function(protocol, messages) {
equal(e.data, '' + a[0]);
a.shift();
if (typeof a[0] === 'undefined') {
- return r.close();
+ r.close();
} else {
- return r.send(a[0]);
+ r.send(a[0]);
}
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
if (a.length) {
ok(false, "Transport closed prematurely. " + e);
} else {
ok(true);
}
- return start();
+ start();
};
};
};
@@ -79,13 +79,13 @@ factor_echo_from_child = function(protocol) {
ok(true, "iframe open");
hookReady = true;
hook.r = r;
- return sockJSReady && hook.callback(code);
+ sockJSReady && hook.callback(code);
};
r.onopen = function(e) {
hook.iobj.loaded();
ok(true, "sockjs open");
sockJSReady = true;
- return hookReady && hook.callback(code);
+ hookReady && hook.callback(code);
};
r.onmessage = function(e) {
clearTimeout(timeout);
@@ -93,7 +93,7 @@ factor_echo_from_child = function(protocol) {
ok(true, "onmessage");
hook.iobj.cleanup();
hook.del();
- return r.close();
+ r.close();
};
hook.onsend = function(e) {
timeout = setTimeout(function() {
@@ -101,8 +101,8 @@ factor_echo_from_child = function(protocol) {
r.close();
}, 300);
};
- return r.onclose = function() {
- return start();
+ r.onclose = function() {
+ start();
};
};
};
@@ -133,27 +133,25 @@ batch_factory_factory = function(protocol, messages) {
ok(r);
counter = 0;
r.onopen = function(e) {
- var msg, _i, _len, _results;
+ var msg, _i, _len;
ok(true);
- _results = [];
for (_i = 0, _len = messages.length; _i < _len; _i++) {
msg = messages[_i];
- _results.push(r.send(msg));
+ r.send(msg);
}
- return _results;
};
r.onmessage = function(e) {
equal(e.data, messages[counter]);
counter += 1;
- if (counter === messages.length) return r.close();
+ if (counter === messages.length) r.close();
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
if (counter !== messages.length) {
ok(false, "Transport closed prematurely. " + e);
} else {
ok(true);
}
- return start();
+ start();
};
};
};
@@ -172,27 +170,25 @@ batch_factory_factory_amp = function(protocol, messages) {
ok(r);
counter = 0;
r.onopen = function(e) {
- var msg, _i, _len, _results;
+ var msg, _i, _len;
ok(true);
- _results = [];
for (_i = 0, _len = messages.length; _i < _len; _i++) {
msg = messages[_i];
- _results.push(r.send('' + msg));
+ r.send('' + msg);
}
- return _results;
};
r.onmessage = function(e) {
equal(e.data.length, Math.pow(2, messages[counter]), e.data);
counter += 1;
- if (counter === messages.length) return r.close();
+ if (counter === messages.length) r.close();
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
if (counter !== messages.length) {
ok(false, "Transport closed prematurely. " + e);
} else {
ok(true);
}
- return start();
+ start();
};
};
};
@@ -254,18 +250,18 @@ factor_user_close = function(protocol) {
counter += 1;
ok(counter === 1);
r.close(3000, "User message");
- return ok(counter === 1);
+ ok(counter === 1);
};
r.onmessage = function() {
ok(false);
- return counter += 1;
+ counter += 1;
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
counter += 1;
u.log('user_close ' + e.code + ' ' + e.reason);
equal(e.wasClean, true);
ok(counter === 2);
- return start();
+ start();
};
};
};
@@ -277,16 +273,16 @@ factor_server_close = function(protocol) {
r = testutils.newSockJS('/close', protocol);
ok(r);
r.onopen = function(e) {
- return ok(true);
+ ok(true);
};
r.onmessage = function(e) {
- return ok(false);
+ ok(false);
};
- return r.onclose = function(e) {
+ r.onclose = function(e) {
equal(e.code, 3000);
equal(e.reason, "Go away!");
equal(e.wasClean, true);
- return start();
+ start();
};
};
};
@@ -302,12 +298,12 @@ arrIndexOf = function(arr, obj) {
test_protocol_messages = function(protocol) {
QUnit.module(protocol);
if (!SockJS[protocol] || !SockJS[protocol].enabled()) {
- return test("[unsupported by client]", function() {
- return ok(true, 'Unsupported protocol (by client): "' + protocol + '"');
+ test("[unsupported by client]", function() {
+ ok(true, 'Unsupported protocol (by client): "' + protocol + '"');
});
} else if (client_opts.disabled_transports && arrIndexOf(client_opts.disabled_transports, protocol) !== -1) {
- return test("[disabled by config]", function() {
- return ok(true, 'Disabled by config: "' + protocol + '"');
+ test("[disabled by config]", function() {
+ ok(true, 'Disabled by config: "' + protocol + '"');
});
} else {
asyncTest("echo1", factor_echo_basic(protocol));
@@ -321,7 +317,7 @@ test_protocol_messages = function(protocol) {
asyncTest("large message (batch)", factor_batch_large(protocol));
asyncTest("large download", factor_batch_large_amp(protocol));
asyncTest("user close", factor_user_close(protocol));
- return asyncTest("server close", factor_server_close(protocol));
+ asyncTest("server close", factor_server_close(protocol));
}
};
diff --git a/tests/html/lib/unittests.js b/tests/html/lib/unittests.js
index 5521115..9032d49 100644
--- a/tests/html/lib/unittests.js
+++ b/tests/html/lib/unittests.js
@@ -6,34 +6,29 @@ QUnit.module('Utils');
var u = require('../../../lib/utils');
test('random_string', function() {
- var i, _i, _len, _ref, _results;
+ var i, _i, _len, _ref;
notEqual(u.random_string(8), u.random_string(8));
_ref = [1, 2, 3, 128];
- _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
- _results.push(equal(u.random_string(i).length, i));
+ equal(u.random_string(i).length, i);
}
- return _results;
});
test('random_number_string', function() {
- var i, _results;
- _results = [];
- for (i = 0; i <= 10; i++) {
+ for (var i = 0; i <= 10; i++) {
equal(u.random_number_string(10).length, 1);
equal(u.random_number_string(100).length, 2);
equal(u.random_number_string(1000).length, 3);
equal(u.random_number_string(10000).length, 4);
- _results.push(equal(u.random_number_string(100000).length, 5));
+ equal(u.random_number_string(100000).length, 5);
}
- return _results;
});
test('getOrigin', function() {
equal(u.getOrigin('http://a.b/'), 'http://a.b');
equal(u.getOrigin('http://a.b/c'), 'http://a.b');
- return equal(u.getOrigin('http://a.b:123/c'), 'http://a.b:123');
+ equal(u.getOrigin('http://a.b:123/c'), 'http://a.b:123');
});
test('isSameOriginUrl', function() {
@@ -52,11 +47,11 @@ test('isSameOriginUrl', function() {
ok(u.isSameOriginUrl('http://127.0.0.1:99', 'http://127.0.0.1:9999') === false);
ok(u.isSameOriginUrl('http://127.0.0.1:999', 'http://127.0.0.1:9999') === false);
ok(u.isSameOriginUrl('http://127.0.0.1:9999', 'http://127.0.0.1:9999'));
- return ok(u.isSameOriginUrl('http://127.0.0.1:99999', 'http://127.0.0.1:9999') === false);
+ ok(u.isSameOriginUrl('http://127.0.0.1:99999', 'http://127.0.0.1:9999') === false);
});
test("getParentDomain", function() {
- var domains, k, _results;
+ var domains, k;
domains = {
'localhost': 'localhost',
'127.0.0.1': '127.0.0.1',
@@ -66,11 +61,9 @@ test("getParentDomain", function() {
'a.org': 'org',
'a2.a3.org': 'a3.org'
};
- _results = [];
for (k in domains) {
- _results.push(equal(u.getParentDomain(k), domains[k]));
+ equal(u.getParentDomain(k), domains[k]);
}
- return _results;
});
test('objectExtend', function() {
@@ -97,7 +90,7 @@ test('objectExtend', function() {
a: 1,
b: 2
});
- return deepEqual(b, {
+ deepEqual(b, {
b: 2
});
});
@@ -110,7 +103,7 @@ test('bind', function() {
};
deepEqual(fun(), window);
bound_fun = u.bind(fun, o);
- return deepEqual(bound_fun(), o);
+ deepEqual(bound_fun(), o);
});
test('amendUrl', function() {
@@ -141,7 +134,7 @@ test('amendUrl', function() {
equal(u.amendUrl('http://a:80/abc'), 'http://a/abc');
equal(u.amendUrl('https://a:443/abc'), 'https://a/abc');
equal(u.amendUrl('https://a:80/abc'), 'https://a:80/abc');
- return equal(u.amendUrl('http://a:443/abc'), 'http://a:443/abc');
+ equal(u.amendUrl('http://a:443/abc'), 'http://a:443/abc');
});
test('arrIndexOf', function() {
@@ -150,7 +143,7 @@ test('arrIndexOf', function() {
equal(u.arrIndexOf(a, 1), 0);
equal(u.arrIndexOf(a, 5), 4);
equal(u.arrIndexOf(a, null), -1);
- return equal(u.arrIndexOf(a, 6), -1);
+ equal(u.arrIndexOf(a, 6), -1);
});
test('arrSkip', function() {
@@ -160,7 +153,7 @@ test('arrSkip', function() {
deepEqual(u.arrSkip(a, 2), [1, 3, 4, 5]);
deepEqual(u.arrSkip(a, 11), [1, 2, 3, 4, 5]);
deepEqual(u.arrSkip(a, 'a'), [1, 2, 3, 4, 5]);
- return deepEqual(u.arrSkip(a, '1'), [1, 2, 3, 4, 5]);
+ deepEqual(u.arrSkip(a, '1'), [1, 2, 3, 4, 5]);
});
test('quote', function() {
@@ -181,7 +174,7 @@ test('quote', function() {
return _results;
})();
all_chars = c.join('');
- return ok(JSON.parse(u.quote(all_chars)) === all_chars, "Quote/unquote all 64K chars.");
+ ok(JSON.parse(u.quote(all_chars)) === all_chars, "Quote/unquote all 64K chars.");
});
test('detectProtocols', function() {
@@ -271,7 +264,7 @@ test('detectProtocols', function() {
deepEqual(u.detectProtocols(ie8_probed, null, {
null_origin: true
}), ['iframe-htmlfile', 'iframe-xhr-polling']);
- return deepEqual(u.detectProtocols(ie10_probed, null, {
+ deepEqual(u.detectProtocols(ie10_probed, null, {
null_origin: true
}), ['websocket', 'iframe-htmlfile', 'iframe-xhr-polling']);
});
@@ -356,7 +349,7 @@ test("EventEmitter", function() {
r.dispatchEvent({
type: 'close'
});
- return r.close();
+ r.close();
});
test("NoConstructor", function() {
@@ -371,5 +364,5 @@ test("NoConstructor", function() {
protocols_whitelist: []
});
ok(r instanceof SockJS);
- return r.close();
+ r.close();
});
--
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