summaryrefslogtreecommitdiff
path: root/js/test/Ice/acm/Client.js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-04-30 21:10:23 +0200
committerJose <jose@zeroc.com>2018-04-30 21:10:23 +0200
commit530608e4ce63dd36d1659b58d1a3fb7fdcf56bea (patch)
treeb5195405b16dd31ac1c486daf7f3ff2572ce6499 /js/test/Ice/acm/Client.js
parentAllow FileParser.Endpoints to be set via Ice::Properties (#58) (diff)
downloadice-530608e4ce63dd36d1659b58d1a3fb7fdcf56bea.tar.bz2
ice-530608e4ce63dd36d1659b58d1a3fb7fdcf56bea.tar.xz
ice-530608e4ce63dd36d1659b58d1a3fb7fdcf56bea.zip
Fix JavaScript errors and warnings report by ESLINT
Close #28
Diffstat (limited to 'js/test/Ice/acm/Client.js')
-rw-r--r--js/test/Ice/acm/Client.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/js/test/Ice/acm/Client.js b/js/test/Ice/acm/Client.js
index 8da91a6c2d9..31f3cce941d 100644
--- a/js/test/Ice/acm/Client.js
+++ b/js/test/Ice/acm/Client.js
@@ -89,18 +89,16 @@
initData.properties.setProperty("Ice.ACM.Timeout", "2");
if(this._clientACMTimeout >= 0)
{
- initData.properties.setProperty("Ice.ACM.Client.Timeout", "" + this._clientACMTimeout);
+ initData.properties.setProperty("Ice.ACM.Client.Timeout", String(this._clientACMTimeout));
}
if(this._clientACMClose >= 0)
{
- initData.properties.setProperty("Ice.ACM.Client.Close", "" + this._clientACMClose);
+ initData.properties.setProperty("Ice.ACM.Client.Close", String(this._clientACMClose));
}
if(this._clientACMHeartbeat >= 0)
{
- initData.properties.setProperty("Ice.ACM.Client.Heartbeat", "" + this._clientACMHeartbeat);
+ initData.properties.setProperty("Ice.ACM.Client.Heartbeat", String(this._clientACMHeartbeat));
}
- //initData.properties.setProperty("Ice.Trace.Protocol", "2");
- //initData.properties.setProperty("Ice.Trace.Network", "2");
this._communicator = Ice.initialize(initData);
this._adapter = await this._com.createObjectAdapter(this._serverACMTimeout,
@@ -135,10 +133,12 @@
{
let prx = await this._adapter.getTestIntf();
prx = Test.TestIntfPrx.uncheckedCast(this._communicator.stringToProxy(prx.toString()));
- let con = await prx.ice_getConnection();
- con.setCloseCallback(connection => this._closed = true);
+ const con = await prx.ice_getConnection();
+ con.setCloseCallback(connection =>
+ {
+ this._closed = true;
+ });
con.setHeartbeatCallback(connection => ++this._heartbeat);
-
await this.runTestCase(this._adapter, prx);
}
catch(ex)
@@ -354,7 +354,7 @@
async runTestCase(adapter, proxy)
{
await Ice.Promise.delay(3000);
- await this._heartbeat >= 3;
+ return this._heartbeat >= 3;
}
}
@@ -413,7 +413,7 @@
async runTestCase(adapter, proxy)
{
- let con = proxy.ice_getCachedConnection();
+ const con = proxy.ice_getCachedConnection();
try
{
@@ -470,7 +470,7 @@
// Skip some tests with IE it opens too many connections and
// IE doesn't allow more than 6 connections.
//
- if(typeof(navigator) !== "undefined" &&
+ if(typeof navigator !== "undefined" &&
["MSIE", "Trident/7.0", "Edge/12", "Edge/13"].some(value => navigator.userAgent.indexOf(value) !== -1))
{
tests.push(new HeartbeatOnIdleTest(com, out));
@@ -496,7 +496,7 @@
await Promise.all(tests.map(test => test.init()));
await Promise.all(tests.map(test => test.start()));
- for(let test of tests)
+ for(const test of tests)
{
test.join(out);
}
@@ -527,7 +527,6 @@
exports._test = run;
exports._runServer = true;
-}
-(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
- typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice._require,
- typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
+}(typeof global !== "undefined" && typeof global.process !== "undefined" ? module : undefined,
+ typeof global !== "undefined" && typeof global.process !== "undefined" ? require : this.Ice._require,
+ typeof global !== "undefined" && typeof global.process !== "undefined" ? exports : this));