summaryrefslogtreecommitdiff
path: root/js/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-07-21 00:15:51 +0200
committerJose <jose@zeroc.com>2015-07-21 00:15:51 +0200
commite537d6c0e62bdbf5b272d6542b3345eb972e9612 (patch)
tree1464b940cb6f2c19e537fd741bf2f31c877163db /js/test
parentFix JavaScript test for non connectable endpoints (diff)
downloadice-e537d6c0e62bdbf5b272d6542b3345eb972e9612.tar.bz2
ice-e537d6c0e62bdbf5b272d6542b3345eb972e9612.tar.xz
ice-e537d6c0e62bdbf5b272d6542b3345eb972e9612.zip
JSHint minor fixes
Minor fixes to issues reported by JSHint
Diffstat (limited to 'js/test')
-rw-r--r--js/test/Ice/hashmap/Client.js30
-rw-r--r--js/test/Ice/hold/Client.js2
-rw-r--r--js/test/Ice/info/Client.js4
-rw-r--r--js/test/Ice/optionalBidir/InitialI.js2
-rw-r--r--js/test/Ice/proxy/Client.js2
5 files changed, 27 insertions, 13 deletions
diff --git a/js/test/Ice/hashmap/Client.js b/js/test/Ice/hashmap/Client.js
index 96c025b3765..f72f2013bd0 100644
--- a/js/test/Ice/hashmap/Client.js
+++ b/js/test/Ice/hashmap/Client.js
@@ -32,7 +32,8 @@
};
var h = new Ice.HashMap(keyComparator, valueComparator);
- for(var i = 0; i < keys.length; ++i)
+ var i;
+ for(i = 0; i < keys.length; ++i)
{
h.set(keys[i], i);
}
@@ -40,7 +41,7 @@
//
// Test the keys.
//
- for(var i = 0; i < keys.length; ++i)
+ for(i = 0; i < keys.length; ++i)
{
test(h.has(keys[i]));
test(h.get(keys[i]) === i);
@@ -62,7 +63,7 @@
fill(a, false);
var k = h.keys();
test(k.length === keys.length);
- for(var i = 0; i < k.length; ++i)
+ for(i = 0; i < k.length; ++i)
{
var p = keys.indexOf(k[i]);
test(p != -1);
@@ -76,7 +77,7 @@
fill(a, false);
var v = h.values();
test(v.length === keys.length);
- for(var i = 0; i < v.length; ++i)
+ for(i = 0; i < v.length; ++i)
{
a[v[i]] = true;
}
@@ -174,7 +175,8 @@
//
var k = [];
k.length = 1000;
- for(var i = 0; i < k.length; ++i)
+ var i;
+ for(i = 0; i < k.length; ++i)
{
k[i] = i;
}
@@ -184,7 +186,7 @@
// Test string keys.
//
k.length = 100;
- for(var i = 0; i < k.length; ++i)
+ for(i = 0; i < k.length; ++i)
{
k[i] = Ice.generateUUID();
}
@@ -203,10 +205,22 @@
//
// Test object keys (with hashCode methods and custom key comparator).
//
+ function createObject(i)
+ {
+ var obj =
+ {
+ key:i,
+ hashCode:function()
+ {
+ return i;
+ }
+ };
+ return obj;
+ }
k.length = 10;
- for(var i = 0; i < k.length; ++i)
+ for(i = 0; i < k.length; ++i)
{
- k[i] = {key:i, hashCode:function() { return i; }};
+ k[i] = createObject(i);
}
var eq = function(a, b) { return a.key === b.key; };
testKeys(k, eq, eq);
diff --git a/js/test/Ice/hold/Client.js b/js/test/Ice/hold/Client.js
index 243ad743eec..cb8a7b7f085 100644
--- a/js/test/Ice/hold/Client.js
+++ b/js/test/Ice/hold/Client.js
@@ -113,7 +113,7 @@
out.write("testing without serialize mode... ");
var result = null;
condition.value = true;
- all = []
+ all = [];
return loop(function()
{
var expected = value;
diff --git a/js/test/Ice/info/Client.js b/js/test/Ice/info/Client.js
index cd866ca535b..0ad3b57f9ae 100644
--- a/js/test/Ice/info/Client.js
+++ b/js/test/Ice/info/Client.js
@@ -107,7 +107,7 @@
info = connection.getInfo();
test(!info.incoming);
- test(info.adapterName.length == 0);
+ test(info.adapterName.length === 0);
if(connection.type() != "ws" && connection.type() != "wss")
{
test(info.localPort > 0);
@@ -152,7 +152,7 @@
test(ctx.get("ws.Connection") == "Upgrade");
test(ctx.get("ws.Sec-WebSocket-Protocol") == "ice.zeroc.com");
test(ctx.get("ws.Sec-WebSocket-Version") == "13");
- test(ctx.get("ws.Sec-WebSocket-Key") != null);
+ test(ctx.get("ws.Sec-WebSocket-Key") !== null);
}
}
);
diff --git a/js/test/Ice/optionalBidir/InitialI.js b/js/test/Ice/optionalBidir/InitialI.js
index f3d38c8c38f..19d932a195c 100644
--- a/js/test/Ice/optionalBidir/InitialI.js
+++ b/js/test/Ice/optionalBidir/InitialI.js
@@ -350,7 +350,7 @@
},
opG: function(g, current)
{
- return g
+ return g;
},
returnOptionalClass: function(req, current)
{
diff --git a/js/test/Ice/proxy/Client.js b/js/test/Ice/proxy/Client.js
index 746b385767f..5796ba5c11d 100644
--- a/js/test/Ice/proxy/Client.js
+++ b/js/test/Ice/proxy/Client.js
@@ -1033,7 +1033,7 @@
{
test(p.ice_getEndpoints()[0].getInfo() instanceof IceSSL.WSSEndpointInfo);
}
- return p.ice_getConnection()
+ return p.ice_getConnection();
}
).then(
function(con)