summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-03-27 12:32:02 +0200
committerJose <jose@zeroc.com>2018-03-27 12:32:02 +0200
commitc21ef10cef69a8549491ce0bf324da6c4412399a (patch)
treeb4de3c62defbaf4028a3431234df44914366a1e5
parentExtra fixes for hold test to break loops in case of error (diff)
downloadice-c21ef10cef69a8549491ce0bf324da6c4412399a.tar.bz2
ice-c21ef10cef69a8549491ce0bf324da6c4412399a.tar.xz
ice-c21ef10cef69a8549491ce0bf324da6c4412399a.zip
JavaScript ESLINT prefer const usage
https://eslint.org/docs/rules/prefer-const
-rw-r--r--js/src/Ice/ACM.js8
-rw-r--r--js/src/Ice/ArrayUtil.js4
-rw-r--r--js/src/Ice/Base64.js14
-rw-r--r--js/src/Ice/ConnectRequestHandler.js2
-rw-r--r--js/src/Ice/ConnectionI.js32
-rw-r--r--js/src/Ice/DefaultsAndOverrides.js8
-rw-r--r--js/src/Ice/EndpointI.js3
-rw-r--r--js/src/Ice/EnumBase.js7
-rw-r--r--js/src/Ice/Exception.js4
-rw-r--r--js/src/Ice/HashMap.js10
-rw-r--r--js/src/Ice/ImplicitContextI.js2
-rw-r--r--js/src/Ice/IncomingAsync.js6
-rw-r--r--js/src/Ice/LocatorInfo.js2
-rw-r--r--js/src/Ice/LocatorManager.js2
-rw-r--r--js/src/Ice/MapUtil.js2
-rw-r--r--js/src/Ice/ObjectAdapterI.js18
-rw-r--r--js/src/Ice/ObjectPrx.js2
-rw-r--r--js/src/Ice/Operation.js40
-rw-r--r--js/src/Ice/OutgoingAsync.js3
-rw-r--r--js/src/Ice/OutgoingConnectionFactory.js14
-rw-r--r--js/src/Ice/Properties.js7
-rw-r--r--js/src/Ice/Reference.js18
-rw-r--r--js/src/Ice/RetryQueue.js2
-rw-r--r--js/src/Ice/RouterManager.js4
-rw-r--r--js/src/Ice/ServantManager.js2
-rw-r--r--js/src/Ice/Stream.js14
-rw-r--r--js/src/Ice/StreamHelpers.js2
-rw-r--r--js/src/Ice/StringUtil.js10
-rw-r--r--js/src/Ice/Struct.js14
-rw-r--r--js/src/Ice/UUID.js4
-rw-r--r--js/src/Ice/WSEndpoint.js4
-rw-r--r--js/src/Ice/WSEndpointFactory.js4
-rw-r--r--js/src/Ice/browser/TimerUtil.js24
33 files changed, 146 insertions, 146 deletions
diff --git a/js/src/Ice/ACM.js b/js/src/Ice/ACM.js
index 871cb999fa1..b7268e4b8f4 100644
--- a/js/src/Ice/ACM.js
+++ b/js/src/Ice/ACM.js
@@ -109,7 +109,7 @@ class FactoryACMMonitor
return;
}
- let i = this._connections.indexOf(connection);
+ const i = this._connections.indexOf(connection);
Debug.assert(i >= 0);
this._connections.splice(i, 1);
if(this._connections.length === 0)
@@ -127,7 +127,7 @@ class FactoryACMMonitor
{
Debug.assert(this._instance !== null);
- let config = new ACMConfig();
+ const config = new ACMConfig();
config.timeout = this._config.timeout;
config.close = this._config.close;
config.heartbeat = this._config.heartbeat;
@@ -157,7 +157,7 @@ class FactoryACMMonitor
{
return null;
}
- let connections = this._reapedConnections;
+ const connections = this._reapedConnections;
this._reapedConnections = [];
return connections;
}
@@ -174,7 +174,7 @@ class FactoryACMMonitor
// Monitor connections outside the thread synchronization, so
// that connections can be added or removed during monitoring.
//
- let now = Date.now();
+ const now = Date.now();
this._connections.forEach(connection =>
{
try
diff --git a/js/src/Ice/ArrayUtil.js b/js/src/Ice/ArrayUtil.js
index fe618398139..162a2d74913 100644
--- a/js/src/Ice/ArrayUtil.js
+++ b/js/src/Ice/ArrayUtil.js
@@ -77,8 +77,8 @@ class ArrayUtil
{
for(let i = arr.length; i > 1; --i)
{
- let e = arr[i - 1];
- let rand = Math.floor(Math.random() * i);
+ const e = arr[i - 1];
+ const rand = Math.floor(Math.random() * i);
arr[i - 1] = arr[rand];
arr[rand] = e;
}
diff --git a/js/src/Ice/Base64.js b/js/src/Ice/Base64.js
index db340f2adb0..bd549baf767 100644
--- a/js/src/Ice/Base64.js
+++ b/js/src/Ice/Base64.js
@@ -75,7 +75,7 @@ class Base64
return "";
}
- let v = [];
+ const v = [];
let by1;
let by2;
@@ -128,8 +128,8 @@ class Base64
}
}
- let retval = v.join("");
- let outString = [];
+ const retval = v.join("");
+ const outString = [];
let iter = 0;
while((retval.length - iter) > 76)
@@ -146,11 +146,11 @@ class Base64
static decode(str) // Returns native Buffer
{
- let newStr = [];
+ const newStr = [];
for(let j = 0; j < str.length; j++)
{
- let c = str.charAt(j);
+ const c = str.charAt(j);
if(Base64.isBase64(c))
{
newStr.push(c);
@@ -168,9 +168,9 @@ class Base64
// size_t totalBytes = (lines * 76) + (((str.size() - (lines * 78)) * 3) / 4);
// Figure out how long the final sequence is going to be.
- let totalBytes = (newStr.length * 3 / 4) + 1;
+ const totalBytes = (newStr.length * 3 / 4) + 1;
- let retval = new Buffer();
+ const retval = new Buffer();
retval.resize(totalBytes);
let by1;
diff --git a/js/src/Ice/ConnectRequestHandler.js b/js/src/Ice/ConnectRequestHandler.js
index 8d06b9b856e..9c708af752f 100644
--- a/js/src/Ice/ConnectRequestHandler.js
+++ b/js/src/Ice/ConnectRequestHandler.js
@@ -122,7 +122,7 @@ class ConnectRequestHandler
// If this proxy is for a non-local object, and we are using a router, then
// add this proxy to the router info object.
//
- let ri = this._reference.getRouterInfo();
+ const ri = this._reference.getRouterInfo();
if(ri !== null)
{
//
diff --git a/js/src/Ice/ConnectionI.js b/js/src/Ice/ConnectionI.js
index 28ad2a4b764..94699a15d1d 100644
--- a/js/src/Ice/ConnectionI.js
+++ b/js/src/Ice/ConnectionI.js
@@ -540,7 +540,7 @@ class ConnectionI
{
for(let i = 0; i < this._sendStreams.length; i++)
{
- let o = this._sendStreams[i];
+ const o = this._sendStreams[i];
if(o.outAsync === outAsync)
{
if(o.requestId > 0)
@@ -565,7 +565,7 @@ class ConnectionI
if(outAsync instanceof Ice.OutgoingAsync)
{
- for(let [key, value] of this._asyncRequests)
+ for(const [key, value] of this._asyncRequests)
{
if(value === outAsync)
{
@@ -1000,7 +1000,7 @@ class ConnectionI
{
if(traceLevels.network >= 2)
{
- let s = [];
+ const s = [];
s.push("failed to establish ");
s.push(this._endpoint.protocol());
s.push(" connection\n");
@@ -1014,7 +1014,7 @@ class ConnectionI
{
if(traceLevels.network >= 1)
{
- let s = [];
+ const s = [];
s.push("closed ");
s.push(this._endpoint.protocol());
s.push(" connection\n");
@@ -1062,7 +1062,7 @@ class ConnectionI
//
for(let i = 0; i < this._sendStreams.length; ++i)
{
- let p = this._sendStreams[i];
+ const p = this._sendStreams[i];
if(p.requestId > 0)
{
this._asyncRequests.delete(p.requestId);
@@ -1072,7 +1072,7 @@ class ConnectionI
this._sendStreams = [];
}
- for(let value of this._asyncRequests.values())
+ for(const value of this._asyncRequests.values())
{
value.completedEx(this._exception);
}
@@ -1150,7 +1150,7 @@ class ConnectionI
{
throw this._exception;
}
- let info = this._transceiver.getInfo();
+ const info = this._transceiver.getInfo();
for(let p = info; p !== null; p = p.underlying)
{
p.adapterName = this._adapter !== null ? this._adapter.getName() : "";
@@ -1586,7 +1586,7 @@ class ConnectionI
const traceLevels = this._instance.traceLevels();
if(traceLevels.network >= 1)
{
- let s = [];
+ const s = [];
if(this._endpoint.datagram())
{
s.push("starting to send ");
@@ -1651,8 +1651,8 @@ class ConnectionI
//
message = this._sendStreams[0];
Debug.assert(!message.prepared);
- let stream = message.stream;
+ const stream = message.stream;
stream.pos = 10;
stream.writeInt(stream.size);
stream.prepareWrite();
@@ -1710,7 +1710,7 @@ class ConnectionI
Debug.assert(!message.prepared);
- let stream = message.stream;
+ const stream = message.stream;
stream.pos = 10;
stream.writeInt(stream.size);
stream.prepareWrite();
@@ -1912,10 +1912,10 @@ class ConnectionI
//
// Prepare the invocation.
//
- let inc = new IncomingAsync(this._instance, this,
- adapter,
- !this._endpoint.datagram() && requestId !== 0, // response
- requestId);
+ const inc = new IncomingAsync(this._instance, this,
+ adapter,
+ !this._endpoint.datagram() && requestId !== 0, // response
+ requestId);
//
// Dispatch the invocation.
@@ -2067,7 +2067,7 @@ class ConnectionI
const ret = this._transceiver.read(buf, this._hasMoreData);
if(this._instance.traceLevels().network >= 3 && buf.position != start)
{
- let s = [];
+ const s = [];
s.push("received ");
if(this._endpoint.datagram())
{
@@ -2094,7 +2094,7 @@ class ConnectionI
const ret = this._transceiver.write(buf);
if(this._instance.traceLevels().network >= 3 && buf.position != start)
{
- let s = [];
+ const s = [];
s.push("sent ");
s.push(buf.position - start);
if(!this._endpoint.datagram())
diff --git a/js/src/Ice/DefaultsAndOverrides.js b/js/src/Ice/DefaultsAndOverrides.js
index 52b1585d221..a2ab8f6cd75 100644
--- a/js/src/Ice/DefaultsAndOverrides.js
+++ b/js/src/Ice/DefaultsAndOverrides.js
@@ -16,9 +16,9 @@ Ice._ModuleRegistry.require(module,
"../Ice/LocalException"
]);
-const FormatType = Ice.FormatType;
-const EndpointSelectionType = Ice.EndpointSelectionType;
-const Protocol = Ice.Protocol;
+const FormatType = Ice.FormatType;
+const EndpointSelectionType = Ice.EndpointSelectionType;
+const Protocol = Ice.Protocol;
class DefaultsAndOverrides
{
@@ -100,7 +100,7 @@ class DefaultsAndOverrides
}
else
{
- let ex = new Ice.EndpointSelectionTypeParseException();
+ const ex = new Ice.EndpointSelectionTypeParseException();
ex.str = "illegal value `" + value + "'; expected `Random' or `Ordered'";
throw ex;
}
diff --git a/js/src/Ice/EndpointI.js b/js/src/Ice/EndpointI.js
index 766c771a3ff..cc96a773597 100644
--- a/js/src/Ice/EndpointI.js
+++ b/js/src/Ice/EndpointI.js
@@ -43,7 +43,7 @@ class EndpointI
for(let i = 0; i < args.length;)
{
- let option = args[i++];
+ const option = args[i++];
if(option.length < 2 || option.charAt(0) != '-')
{
unknown.push(option);
@@ -72,6 +72,7 @@ class EndpointI
args.push(unknown[i]);
}
}
+
//
// Compare endpoints for sorting purposes
//
diff --git a/js/src/Ice/EnumBase.js b/js/src/Ice/EnumBase.js
index 2954511a296..bf8fdf53368 100644
--- a/js/src/Ice/EnumBase.js
+++ b/js/src/Ice/EnumBase.js
@@ -101,10 +101,11 @@ Slice.defineEnum = function(enumerators)
let maxValue = 0;
let firstEnum = null;
- for(let idx in enumerators)
+ for(const idx in enumerators)
{
- let e = enumerators[idx][0], value = enumerators[idx][1];
- let enumerator = new type(e, value);
+ const e = enumerators[idx][0];
+ const value = enumerators[idx][1];
+ const enumerator = new type(e, value);
enums[value] = enumerator;
if(!firstEnum)
{
diff --git a/js/src/Ice/Exception.js b/js/src/Ice/Exception.js
index a773e4c3ca4..fa5ed01ce2d 100644
--- a/js/src/Ice/Exception.js
+++ b/js/src/Ice/Exception.js
@@ -35,7 +35,7 @@ const toString = function(key, object, objectTable, ident)
objectTable.push(object);
let s = "\n" + ident + key + ":";
- for(let k in object)
+ for(const k in object)
{
if(key.indexOf("_") === 0)
{
@@ -105,7 +105,7 @@ class Exception extends Error
this._inToStringAlready = true;
let s = this.ice_id();
- for(let key in this)
+ for(const key in this)
{
if(key != "_inToStringAlready")
{
diff --git a/js/src/Ice/HashMap.js b/js/src/Ice/HashMap.js
index d20e1db0009..feff178e07c 100644
--- a/js/src/Ice/HashMap.js
+++ b/js/src/Ice/HashMap.js
@@ -263,7 +263,7 @@ class HashMap
//
// Create a new table entry.
//
- let e = Object.create(null, {
+ const e = Object.create(null, {
"key": {
enumerable: true,
get: function() { return this._key; }
@@ -333,7 +333,7 @@ class HashMap
//
for(let e = this._head; e !== null; e = e._next)
{
- let index = this.hashIndex(e._hash, capacity);
+ const index = this.hashIndex(e._hash, capacity);
e._nextInBucket = newTable[index];
newTable[index] = e;
}
@@ -344,7 +344,7 @@ class HashMap
findEntry(key, hash)
{
- let index = this.hashIndex(hash, this._table.length);
+ const index = this.hashIndex(hash, this._table.length);
//
// Search for an entry with the same key.
//
@@ -375,7 +375,7 @@ class HashMap
{
if(HashMap._null === null)
{
- let uuid = Ice.generateUUID();
+ const uuid = Ice.generateUUID();
HashMap._null = {key:uuid, hash:StringUtil.hashCode(uuid)};
}
return HashMap._null;
@@ -402,7 +402,7 @@ class HashMap
{
if(HashMap._nan === null)
{
- let uuid = Ice.generateUUID();
+ const uuid = Ice.generateUUID();
HashMap._nan = {key:uuid, hash:StringUtil.hashCode(uuid)};
}
return HashMap._nan;
diff --git a/js/src/Ice/ImplicitContextI.js b/js/src/Ice/ImplicitContextI.js
index e9f568926b8..6b7c1646d52 100644
--- a/js/src/Ice/ImplicitContextI.js
+++ b/js/src/Ice/ImplicitContextI.js
@@ -121,7 +121,7 @@ class ImplicitContextI
else
{
ctx = new Context(this._context);
- for(let [key, value] of prxContext)
+ for(const [key, value] of prxContext)
{
ctx.set(key, value);
}
diff --git a/js/src/Ice/IncomingAsync.js b/js/src/Ice/IncomingAsync.js
index 3b779fec94a..d5503b8d897 100644
--- a/js/src/Ice/IncomingAsync.js
+++ b/js/src/Ice/IncomingAsync.js
@@ -296,8 +296,8 @@ class IncomingAsync
this._os.writeBlob(Protocol.replyHdr);
this._os.writeInt(this._current.requestId);
this._os.writeByte(Protocol.replyUnknownLocalException);
- //this._os.writeString(ex.toString());
- let s = [ ex.ice_id() ];
+ // this._os.writeString(ex.toString());
+ const s = [ex.ice_id()];
if(ex.stack)
{
s.push("\n");
@@ -454,7 +454,7 @@ class IncomingAsync
try
{
Debug.assert(this._servant !== null);
- let promise = this._servant._iceDispatch(this, this._current);
+ const promise = this._servant._iceDispatch(this, this._current);
if(promise !== null)
{
promise.then(() => this.completed(null, true), (ex) => this.completed(ex, true));
diff --git a/js/src/Ice/LocatorInfo.js b/js/src/Ice/LocatorInfo.js
index f9c01bb331f..e4085e307f0 100644
--- a/js/src/Ice/LocatorInfo.js
+++ b/js/src/Ice/LocatorInfo.js
@@ -467,7 +467,7 @@ class RequestCallback
let endpoints = null;
if(proxy !== null)
{
- let r = proxy._getReference();
+ const r = proxy._getReference();
if(this._ref.isWellKnown() && !Protocol.isSupported(this._ref.getEncoding(), r.getEncoding()))
{
//
diff --git a/js/src/Ice/LocatorManager.js b/js/src/Ice/LocatorManager.js
index e2f72f25eb4..c046c307559 100644
--- a/js/src/Ice/LocatorManager.js
+++ b/js/src/Ice/LocatorManager.js
@@ -32,7 +32,7 @@ class LocatorManager
destroy()
{
- for(let locator of this._table.values())
+ for(const locator of this._table.values())
{
locator.destroy();
}
diff --git a/js/src/Ice/MapUtil.js b/js/src/Ice/MapUtil.js
index 6e508f1c954..f93b090b285 100644
--- a/js/src/Ice/MapUtil.js
+++ b/js/src/Ice/MapUtil.js
@@ -23,7 +23,7 @@ class MapUtil
}
else
{
- for(let [key, value] of m1)
+ for(const [key, value] of m1)
{
if(value === undefined)
{
diff --git a/js/src/Ice/ObjectAdapterI.js b/js/src/Ice/ObjectAdapterI.js
index 5575e879923..a6c65d266e6 100644
--- a/js/src/Ice/ObjectAdapterI.js
+++ b/js/src/Ice/ObjectAdapterI.js
@@ -551,7 +551,7 @@ class ObjectAdapterI
//
// Remove duplicate endpoints, so we have a list of unique endpoints.
//
- let endpoints = [];
+ const endpoints = [];
endpts.forEach(endpoint =>
{
if(endpoints.findIndex(value => endpoint.equals(value)) === -1)
@@ -569,8 +569,8 @@ class ObjectAdapterI
// Parse published endpoints. If set, these are used in proxies
// instead of the connection factory Endpoints.
//
- let endpoints = [];
- let s = this._instance.initializationData().properties.getProperty(this._name + ".PublishedEndpoints");
+ const endpoints = [];
+ const s = this._instance.initializationData().properties.getProperty(this._name + ".PublishedEndpoints");
const delim = " \t\n\r";
let end = 0;
@@ -630,8 +630,8 @@ class ObjectAdapterI
}
}
- let es = s.substring(beg, end);
- let endp = this._instance.endpointFactoryManager().create(es, false);
+ const es = s.substring(beg, end);
+ const endp = this._instance.endpointFactoryManager().create(es, false);
if(endp == null)
{
throw new Ice.EndpointParseException("invalid object adapter endpoint `" + s + "'");
@@ -646,9 +646,9 @@ class ObjectAdapterI
{
if(this._instance.traceLevels().network >= 1 && endpoints.length > 0)
{
- let s = [];
+ const s = [];
s.push("published endpoints for object adapter `");
- s.push(_name);
+ s.push(this._name);
s.push("':\n");
let first = true;
endpoints.forEach(endpoint =>
@@ -683,8 +683,8 @@ class ObjectAdapterI
}
let noProps = true;
- let props = this._instance.initializationData().properties.getPropertiesForPrefix(prefix);
- for(let [key, value] of props)
+ const props = this._instance.initializationData().properties.getPropertiesForPrefix(prefix);
+ for(const [key, value] of props)
{
let valid = false;
for(let i = 0; i < _suffixes.length; ++i)
diff --git a/js/src/Ice/ObjectPrx.js b/js/src/Ice/ObjectPrx.js
index 9f078087eb9..cb1b03b25e3 100644
--- a/js/src/Ice/ObjectPrx.js
+++ b/js/src/Ice/ObjectPrx.js
@@ -881,7 +881,7 @@ class ObjectPrx
return true;
}
- for(let i in this._implements)
+ for(const i in this._implements)
{
if(this._implements[i]._instanceof(T))
{
diff --git a/js/src/Ice/Operation.js b/js/src/Ice/Operation.js
index a74a6a6d3b7..6b6d0495567 100644
--- a/js/src/Ice/Operation.js
+++ b/js/src/Ice/Operation.js
@@ -94,7 +94,7 @@ function parseOperation(name, arr)
{
for(let i = 0; i < arr[5].length; ++i)
{
- let p = parseParam(arr[5][i]);
+ const p = parseParam(arr[5][i]);
p.pos = i;
inParams.push(p);
if(p.tag)
@@ -114,7 +114,7 @@ function parseOperation(name, arr)
const offs = ret ? 1 : 0;
for(let i = 0; i < arr[6].length; ++i)
{
- let p = parseParam(arr[6][i]);
+ const p = parseParam(arr[6][i]);
p.pos = i + offs;
outParams.push(p);
if(p.tag)
@@ -241,7 +241,7 @@ function marshalParams(os, params, retvalInfo, paramInfo, optParamInfo, usesClas
//
for(let i = 0; i < paramInfo.length; ++i)
{
- let p = paramInfo[i];
+ const p = paramInfo[i];
if(!p.tag)
{
p.type.write(os, params[p.pos]);
@@ -261,7 +261,7 @@ function marshalParams(os, params, retvalInfo, paramInfo, optParamInfo, usesClas
//
for(let i = 0; i < optParamInfo.length; ++i)
{
- let p = optParamInfo[i];
+ const p = optParamInfo[i];
p.type.writeOptional(os, p.tag, params[p.pos]);
}
@@ -302,9 +302,9 @@ function dispatchImpl(servant, op, incomingAsync, current)
incomingAsync.setFormat(op.format);
- let marshalFn = function(params)
+ const marshalFn = function(params)
{
- let numExpectedResults = op.outParams.length + (op.returns ? 1 : 0);
+ const numExpectedResults = op.outParams.length + (op.returns ? 1 : 0);
if(numExpectedResults > 1 && !(params instanceof Array))
{
throw new Ice.MarshalException("operation `" + op.servantMethod + "' should return an array");
@@ -339,7 +339,7 @@ function dispatchImpl(servant, op, incomingAsync, current)
}
};
- let results = method.apply(servant, params);
+ const results = method.apply(servant, params);
if(results instanceof Promise)
{
return results.then(marshalFn);
@@ -356,7 +356,7 @@ function getServantMethodFromInterfaces(interfaces, methodName, all)
let method;
for(let i = 0; method === undefined && i < interfaces.length; ++i)
{
- let intf = interfaces[i];
+ const intf = interfaces[i];
method = intf[methodName];
if(method === undefined)
{
@@ -450,7 +450,7 @@ function getServantMethod(servantType, name)
//
for(let i = 0; op === undefined && i < allInterfaces.length; ++i)
{
- let intf = allInterfaces[i];
+ const intf = allInterfaces[i];
if(intf._iceOps)
{
if((op = intf._iceOps.find(name)) !== undefined)
@@ -488,13 +488,13 @@ function getServantMethod(servantType, name)
function addProxyOperation(proxyType, name, data)
{
- let method = data[0] ? data[0] : name;
+ const method = data[0] ? data[0] : name;
let op = null;
proxyType.prototype[method] = function()
{
- let args = arguments;
+ const args = arguments;
//
// Parse the operation data on the first invocation of a proxy method.
@@ -504,7 +504,7 @@ function addProxyOperation(proxyType, name, data)
op = parseOperation(name, data);
}
- let ctx = args[op.inParams.length]; // The request context is the last argument (if present).
+ const ctx = args[op.inParams.length]; // The request context is the last argument (if present).
let marshalFn = null;
if(op.inParams.length > 0)
@@ -516,8 +516,8 @@ function addProxyOperation(proxyType, name, data)
//
for(let i = 0; i < op.inParams.length; ++i)
{
- let p = op.inParams[i];
- let v = params[p.pos];
+ const p = op.inParams[i];
+ const v = params[p.pos];
if(!p.tag || v !== undefined)
{
if(typeof p.type.validate === "function")
@@ -545,9 +545,9 @@ function addProxyOperation(proxyType, name, data)
//
// [retval, out1, out2, ..., asyncResult]
//
- let results = [];
+ const results = [];
- let is = asyncResult.startReadParams();
+ const is = asyncResult.startReadParams();
let retvalInfo;
if(op.returns && !op.returns.tag)
{
@@ -608,7 +608,7 @@ Slice.defineOperations = function(classType, proxyType, ids, pos, ops)
{
if(ops)
{
- for(let name in ops)
+ for(const name in ops)
{
addProxyOperation(proxyType, name, ops[name]);
}
@@ -619,10 +619,10 @@ Slice.defineOperations = function(classType, proxyType, ids, pos, ops)
//
if(proxyType._implements)
{
- for(let intf in proxyType._implements)
+ for(const intf in proxyType._implements)
{
- let proto = proxyType._implements[intf].prototype;
- for(let f in proto)
+ const proto = proxyType._implements[intf].prototype;
+ for(const f in proto)
{
if(typeof proto[f] == "function" && proxyType.prototype[f] === undefined)
{
diff --git a/js/src/Ice/OutgoingAsync.js b/js/src/Ice/OutgoingAsync.js
index 897f013ea93..0fdfe1cb794 100644
--- a/js/src/Ice/OutgoingAsync.js
+++ b/js/src/Ice/OutgoingAsync.js
@@ -595,8 +595,7 @@ class HeartbeatAsync extends OutgoingAsyncBase
this._os.writeByte(0);
this._os.writeInt(Protocol.headerSize); // Message size.
- let status = this._connection.sendAsyncRequest(this, false, 0);
-
+ const status = this._connection.sendAsyncRequest(this, false, 0);
if((status & AsyncStatus.Sent) > 0)
{
this._sentSynchronously = true;
diff --git a/js/src/Ice/OutgoingConnectionFactory.js b/js/src/Ice/OutgoingConnectionFactory.js
index 59bd28018d4..79ad1327686 100644
--- a/js/src/Ice/OutgoingConnectionFactory.js
+++ b/js/src/Ice/OutgoingConnectionFactory.js
@@ -394,10 +394,10 @@ class OutgoingConnectionFactory
connectionCallbacks.push(cb);
}
- let callbacks = [];
+ const callbacks = [];
endpoints.forEach(endpt =>
{
- let cbs = this._pending.get(endpt);
+ const cbs = this._pending.get(endpt);
if(cbs !== undefined)
{
this._pending.delete(endpt);
@@ -424,7 +424,7 @@ class OutgoingConnectionFactory
connectionCallbacks.forEach(cc =>
{
cc.removeFromPending();
- let idx = callbacks.indexOf(cc);
+ const idx = callbacks.indexOf(cc);
if(idx !== -1)
{
callbacks.splice(idx, 1);
@@ -692,7 +692,7 @@ class ConnectionListMap extends HashMap
forEach(fn)
{
- for(let connections of this.values())
+ for(const connections of this.values())
{
connections.forEach(fn);
}
@@ -763,7 +763,7 @@ class ConnectCallback
{
endpoints.forEach(endpoint =>
{
- let idx = this.findEndpoint(endpoint);
+ const idx = this.findEndpoint(endpoint);
if(idx !== -1)
{
this._endpoints.splice(idx, 1);
@@ -854,7 +854,7 @@ class ConnectCallback
if(traceLevels.network >= 2)
{
- let s = [];
+ const s = [];
s.push("trying to establish ");
s.push(this._current.protocol());
s.push(" connection to ");
@@ -868,7 +868,7 @@ class ConnectCallback
{
if(traceLevels.network >= 2)
{
- let s = [];
+ const s = [];
s.push("failed to establish ");
s.push(this._current.protocol());
s.push(" connection to ");
diff --git a/js/src/Ice/Properties.js b/js/src/Ice/Properties.js
index c06559b0670..6574e7ed064 100644
--- a/js/src/Ice/Properties.js
+++ b/js/src/Ice/Properties.js
@@ -41,8 +41,7 @@ class Properties
// NOTE: we can't just do a shallow copy of the map as the map values
// would otherwise be shared between the two PropertiesI object.
//
- //_properties = new Map(pi._properties);
- for(let [key, property] of defaults._properties)
+ for(const [key, property] of defaults._properties)
{
this._properties.set(key, { 'value': property.value, 'used': false });
}
@@ -50,7 +49,7 @@ class Properties
if(args !== undefined && args !== null)
{
- let v = this.parseIceCommandLineOptions(args);
+ const v = this.parseIceCommandLineOptions(args);
args.length = 0;
for(let i = 0; i < v.length; ++i)
{
@@ -236,7 +235,7 @@ class Properties
//
if(value !== null && value.length > 0)
{
- let pv = this._properties.get(key);
+ const pv = this._properties.get(key);
if(pv !== undefined)
{
pv.value = value;
diff --git a/js/src/Ice/Reference.js b/js/src/Ice/Reference.js
index ea26b5a086e..35c94b4b961 100644
--- a/js/src/Ice/Reference.js
+++ b/js/src/Ice/Reference.js
@@ -249,10 +249,10 @@ class ReferenceFactory
// quotation marks.
//
let argument = null;
- let argumentBeg = StringUtil.findFirstNotOf(s, delim, end);
+ const argumentBeg = StringUtil.findFirstNotOf(s, delim, end);
if(argumentBeg != -1)
{
- let ch = s.charAt(argumentBeg);
+ const ch = s.charAt(argumentBeg);
if(ch != "@" && ch != ":" && ch != "-")
{
beg = argumentBeg;
@@ -421,11 +421,11 @@ class ReferenceFactory
return this.createImpl(ident, facet, mode, secure, protocol, encoding, null, null, propertyPrefix);
}
- let endpoints = [];
+ const endpoints = [];
if(s.charAt(beg) == ':')
{
- let unknownEndpoints = [];
+ const unknownEndpoints = [];
end = beg;
while(end < s.length && s.charAt(end) == ':')
@@ -475,8 +475,8 @@ class ReferenceFactory
}
}
- let es = s.substring(beg, end);
- let endp = this._instance.endpointFactoryManager().create(es, false);
+ const es = s.substring(beg, end);
+ const endp = this._instance.endpointFactoryManager().create(es, false);
if(endp !== null)
{
endpoints.push(endp);
@@ -684,12 +684,12 @@ class ReferenceFactory
}
}
- let properties = this._instance.initializationData().properties.getPropertiesForPrefix(prefix + ".");
+ const properties = this._instance.initializationData().properties.getPropertiesForPrefix(prefix + ".");
unknownProps = unknownProps.concat(Array.from(properties.keys()).filter(
key => !suffixes.some(suffix => key === prefix + "." + suffix)));
if(unknownProps.length > 0)
{
- let message = [];
+ const message = [];
message.push("found unknown properties for proxy '");
message.push(prefix);
message.push("':");
@@ -1173,7 +1173,7 @@ class Reference
h = HashUtil.addHashable(h, this._identity);
if(this._context !== null && this._context !== undefined)
{
- for(let [key, value] of this._context)
+ for(const [key, value] of this._context)
{
h = HashUtil.addString(h, key);
h = HashUtil.addString(h, value);
diff --git a/js/src/Ice/RetryQueue.js b/js/src/Ice/RetryQueue.js
index deb15afc2a3..4f36821da47 100644
--- a/js/src/Ice/RetryQueue.js
+++ b/js/src/Ice/RetryQueue.js
@@ -64,7 +64,7 @@ class RetryQueue
{
throw new Ice.CommunicatorDestroyedException();
}
- let task = new RetryTask(this._instance, this, outAsync);
+ const task = new RetryTask(this._instance, this, outAsync);
outAsync.cancelable(task); // This will throw if the request is canceled
task.token = this._instance.timer().schedule(() => task.run(), interval);
this._requests.push(task);
diff --git a/js/src/Ice/RouterManager.js b/js/src/Ice/RouterManager.js
index a7cf93400c6..0e9661c8cba 100644
--- a/js/src/Ice/RouterManager.js
+++ b/js/src/Ice/RouterManager.js
@@ -23,7 +23,7 @@ class RouterManager
destroy()
{
- for(let router of this._table.values())
+ for(const router of this._table.values())
{
router.destroy();
}
@@ -62,7 +62,7 @@ class RouterManager
if(rtr !== null)
{
// The router cannot be routed.
- let router = RouterPrx.uncheckedCast(rtr.ice_router(null));
+ const router = RouterPrx.uncheckedCast(rtr.ice_router(null));
info = this._table.get(router);
this._table.delete(router);
diff --git a/js/src/Ice/ServantManager.js b/js/src/Ice/ServantManager.js
index 2fdbbd1bcb1..b858a0ecf80 100644
--- a/js/src/Ice/ServantManager.js
+++ b/js/src/Ice/ServantManager.js
@@ -287,7 +287,7 @@ class ServantManager
this._locatorMap.clear();
this._instance = null;
- for(let [key, locator] of locatorMap)
+ for(const [key, locator] of locatorMap)
{
try
{
diff --git a/js/src/Ice/Stream.js b/js/src/Ice/Stream.js
index 6a02480d0a7..eb8fdd1dd45 100644
--- a/js/src/Ice/Stream.js
+++ b/js/src/Ice/Stream.js
@@ -392,7 +392,7 @@ class EncapsDecoder10 extends EncapsDecoder
if(this._sliceType === SliceType.ValueSlice)
{
this.startSlice();
- let sz = this._stream.readSize(); // For compatibility with the old AFM.
+ const sz = this._stream.readSize(); // For compatibility with the old AFM.
if(sz !== 0)
{
throw new Ice.MarshalException("invalid Object slice");
@@ -424,7 +424,7 @@ class EncapsDecoder10 extends EncapsDecoder
//
if(this._sliceType === SliceType.ValueSlice) // For exceptions, the type ID is always encoded as a string
{
- let isIndex = this._stream.readBool();
+ const isIndex = this._stream.readBool();
this._typeId = this.readTypeId(isIndex);
}
else
@@ -477,7 +477,7 @@ class EncapsDecoder10 extends EncapsDecoder
readInstance()
{
- let index = this._stream.readInt();
+ const index = this._stream.readInt();
let v = null;
if(index <= 0)
@@ -738,11 +738,11 @@ class EncapsDecoder11 extends EncapsDecoder
//
if((this._current.sliceFlags & Protocol.FLAG_HAS_INDIRECTION_TABLE) !== 0)
{
- let indirectionTable = [];
+ const indirectionTable = [];
//
// The table is written as a sequence<size> to conserve space.
//
- let length = this._stream.readAndCheckSeqSize(1);
+ const length = this._stream.readAndCheckSeqSize(1);
for(let i = 0; i < length; ++i)
{
indirectionTable[i] = this.readInstance(this._stream.readSize(), null);
@@ -853,8 +853,8 @@ class EncapsDecoder11 extends EncapsDecoder
if((this._current.sliceFlags & Protocol.FLAG_HAS_INDIRECTION_TABLE) !== 0)
{
- let length = this._stream.readAndCheckSeqSize(1);
- let indirectionTable = [];
+ const length = this._stream.readAndCheckSeqSize(1);
+ const indirectionTable = [];
for(let i = 0; i < length; ++i)
{
indirectionTable[i] = this.readInstance(this._stream.readSize(), null);
diff --git a/js/src/Ice/StreamHelpers.js b/js/src/Ice/StreamHelpers.js
index df1cb86de28..fb0d12986c9 100644
--- a/js/src/Ice/StreamHelpers.js
+++ b/js/src/Ice/StreamHelpers.js
@@ -235,7 +235,7 @@ class DictionaryHelper
const keyHelper = this.keyHelper;
const valueHelper = this.valueHelper;
os.writeSize(v.size);
- for(let [key, value] of v)
+ for(const [key, value] of v)
{
keyHelper.write(os, key);
valueHelper.write(os, value);
diff --git a/js/src/Ice/StringUtil.js b/js/src/Ice/StringUtil.js
index 91cf7ef943d..2d7ae9ac64f 100644
--- a/js/src/Ice/StringUtil.js
+++ b/js/src/Ice/StringUtil.js
@@ -65,7 +65,7 @@ Ice.StringUtil = class
}
}
- let result = [];
+ const result = [];
if(toStringMode === Ice.ToStringMode.Compat)
{
@@ -230,7 +230,7 @@ Ice.StringUtil = class
{
start = start === undefined ? 0 : start;
- let quoteChar = s.charAt(start);
+ const quoteChar = s.charAt(start);
if(quoteChar == '"' || quoteChar == '\'')
{
start++;
@@ -556,7 +556,7 @@ function decodeChar(s, start, end, special, result)
{
// UTF-8 byte sequence encoded with octal or hex escapes
- let arr = [];
+ const arr = [];
let more = true;
while(more)
{
@@ -596,7 +596,7 @@ function decodeChar(s, start, end, special, result)
{
for(let j = 0; j < 3 && start < end; ++j)
{
- let charVal = s.charCodeAt(start++) - '0'.charCodeAt(0);
+ const charVal = s.charCodeAt(start++) - '0'.charCodeAt(0);
if(charVal < 0 || charVal > 7)
{
--start; // move back
@@ -617,7 +617,7 @@ function decodeChar(s, start, end, special, result)
if((start + 1 < end) && s.charAt(start) === '\\')
{
c = s.charAt(start + 1);
- let charVal = s.charCodeAt(start + 1);
+ const charVal = s.charCodeAt(start + 1);
if(c === 'x' || (charVal >= 0x30 && charVal <= 0x39))
{
start++;
diff --git a/js/src/Ice/Struct.js b/js/src/Ice/Struct.js
index f302ec4c252..96a4a2a3bb2 100644
--- a/js/src/Ice/Struct.js
+++ b/js/src/Ice/Struct.js
@@ -39,10 +39,10 @@ function equals(other)
return false;
}
- for(let key in this)
+ for(const key in this)
{
- let e1 = this[key];
- let e2 = other[key];
+ const e1 = this[key];
+ const e2 = other[key];
if(typeof e1 == "function")
{
continue; // Don't need to compare functions
@@ -58,9 +58,9 @@ function equals(other)
function clone()
{
const other = new this.constructor();
- for(let key in this)
+ for(const key in this)
{
- let e = this[key];
+ const e = this[key];
if(e === undefined || e === null)
{
other[key] = e;
@@ -116,9 +116,9 @@ function memberHashCode(h, e)
function hashCode()
{
let h = 5381;
- for(let key in this)
+ for(const key in this)
{
- let e = this[key];
+ const e = this[key];
if(e === undefined || e === null || typeof e == "function")
{
continue;
diff --git a/js/src/Ice/UUID.js b/js/src/Ice/UUID.js
index 5875a175d34..407be4b0506 100644
--- a/js/src/Ice/UUID.js
+++ b/js/src/Ice/UUID.js
@@ -10,8 +10,8 @@
function generateUUID()
{
let d = new Date().getTime();
- let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
- let r = (d + Math.random() * 16) % 16 | 0;
+ const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
+ const r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
diff --git a/js/src/Ice/WSEndpoint.js b/js/src/Ice/WSEndpoint.js
index 0548c35afff..cf588c89050 100644
--- a/js/src/Ice/WSEndpoint.js
+++ b/js/src/Ice/WSEndpoint.js
@@ -33,7 +33,7 @@ class WSEndpoint extends EndpointI
getInfo()
{
- let info = new Ice.WSEndpointInfo();
+ const info = new Ice.WSEndpointInfo();
info.type = () => this.type();
info.datagram = () => this.datagram();
info.secure = () => this.secure();
@@ -153,7 +153,7 @@ class WSEndpoint extends EndpointI
return this.type() < p.type() ? -1 : 1;
}
- let r = this._delegate.compareTo(p._delegate);
+ const r = this._delegate.compareTo(p._delegate);
if(r !== 0)
{
return r;
diff --git a/js/src/Ice/WSEndpointFactory.js b/js/src/Ice/WSEndpointFactory.js
index 66fb2b38c4e..6f32038c0cb 100644
--- a/js/src/Ice/WSEndpointFactory.js
+++ b/js/src/Ice/WSEndpointFactory.js
@@ -31,14 +31,14 @@ class WSEndpointFactory extends WSEndpoint
create(args, oaEndpoint)
{
- let e = new WSEndpoint(this._instance, this._delegate.create(args, oaEndpoint));
+ const e = new WSEndpoint(this._instance, this._delegate.create(args, oaEndpoint));
e.initWithOptions(args);
return e;
}
read(s)
{
- let e = new WSEndpoint(this._instance, this._delegate.read(s));
+ const e = new WSEndpoint(this._instance, this._delegate.read(s));
e.initWithStream(s);
return e;
}
diff --git a/js/src/Ice/browser/TimerUtil.js b/js/src/Ice/browser/TimerUtil.js
index 4429ce16fee..f34b1c35010 100644
--- a/js/src/Ice/browser/TimerUtil.js
+++ b/js/src/Ice/browser/TimerUtil.js
@@ -23,7 +23,7 @@ const Ice = require("../Ice/ModuleRegistry").Ice;
//
function createTimerObject()
{
- let Timer = class
+ const Timer = class
{
static setTimeout(cb, ms)
{
@@ -68,16 +68,16 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
const _timers = new Map();
-const _SetTimeoutType = 0,
- _SetIntervalType = 1,
- _SetImmediateType = 2,
- _ClearTimeoutType = 3,
- _ClearIntervalType = 4;
+const _SetTimeoutType = 0;
+const _SetIntervalType = 1;
+const _SetImmediateType = 2;
+const _ClearTimeoutType = 3;
+const _ClearIntervalType = 4;
let worker;
let _nextId = 0;
-var nextId = function()
+const nextId = function()
{
if(_nextId == MAX_SAFE_INTEGER)
{
@@ -146,11 +146,11 @@ const workerCode = function()
//
// jshint worker: true
//
- const _wSetTimeoutType = 0,
- _wSetIntervalType = 1,
- _wSetImmediateType = 2,
- _wClearTimeoutType = 3,
- _wClearIntervalType = 4;
+ const _wSetTimeoutType = 0;
+ const _wSetIntervalType = 1;
+ const _wSetImmediateType = 2;
+ const _wClearTimeoutType = 3;
+ const _wClearIntervalType = 4;
const timers = {};