Skip to content
Permalink
Browse files

[JS] eslint: prefer template literals

Change-Id: I26d14f896464b9acf286855241155cec13a5a61e
  • Loading branch information...
Max van gen Hassend Max van gen Hassend
Max van gen Hassend authored and Max van gen Hassend committed May 24, 2018
1 parent 72e8f98 commit 4a8e97bebc5fa458594ce680bb778e376a1ac6e3
Showing with 547 additions and 701 deletions.
  1. +1 −0 .eslintrc.js
  2. +3 −2 javascript/libjoynr-js/src/main/js/global/JoynrPersist.js
  3. +1 −1 javascript/libjoynr-js/src/main/js/global/LocalStorageNode.js
  4. +1 −1 javascript/libjoynr-js/src/main/js/global/WebSocket.js
  5. +5 −11 javascript/libjoynr-js/src/main/js/joynr/capabilities/CapabilitiesRegistrar.js
  6. +1 −1 javascript/libjoynr-js/src/main/js/joynr/capabilities/ParticipantIdStorage.js
  7. +9 −18 javascript/libjoynr-js/src/main/js/joynr/capabilities/arbitration/Arbitrator.js
  8. +12 −13 javascript/libjoynr-js/src/main/js/joynr/capabilities/discovery/CapabilityDiscovery.js
  9. +34 −35 javascript/libjoynr-js/src/main/js/joynr/dispatching/Dispatcher.js
  10. +23 −34 javascript/libjoynr-js/src/main/js/joynr/dispatching/RequestReplyManager.js
  11. +76 −151 javascript/libjoynr-js/src/main/js/joynr/dispatching/subscription/PublicationManager.js
  12. +42 −38 javascript/libjoynr-js/src/main/js/joynr/dispatching/subscription/SubscriptionManager.js
  13. +6 −8 javascript/libjoynr-js/src/main/js/joynr/dispatching/subscription/util/SubscriptionUtil.js
  14. +1 −1 javascript/libjoynr-js/src/main/js/joynr/dispatching/types/Request.js
  15. +2 −2 javascript/libjoynr-js/src/main/js/joynr/messaging/JoynrMessage.js
  16. +2 −2 javascript/libjoynr-js/src/main/js/joynr/messaging/MessageSerializer.js
  17. +3 −5 javascript/libjoynr-js/src/main/js/joynr/messaging/MessagingQos.js
  18. +3 −6 javascript/libjoynr-js/src/main/js/joynr/messaging/MessagingSkeletonFactory.js
  19. +3 −6 javascript/libjoynr-js/src/main/js/joynr/messaging/MessagingStubFactory.js
  20. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/browser/BrowserMessagingSkeleton.js
  21. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/mqtt/MqttMessagingSkeleton.js
  22. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/mqtt/MqttMessagingStub.js
  23. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/mqtt/SharedMqttClient.js
  24. +28 −37 javascript/libjoynr-js/src/main/js/joynr/messaging/routing/MessageRouter.js
  25. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/util/MulticastWildcardRegexFactory.js
  26. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/webmessaging/WebMessagingStub.js
  27. +11 −17 javascript/libjoynr-js/src/main/js/joynr/messaging/websocket/SharedWebSocket.js
  28. +1 −1 javascript/libjoynr-js/src/main/js/joynr/messaging/websocket/WebSocketMessagingSkeleton.js
  29. +2 −2 javascript/libjoynr-js/src/main/js/joynr/provider/BroadcastOutputParameters.js
  30. +2 −2 javascript/libjoynr-js/src/main/js/joynr/provider/ProviderAttribute.js
  31. +6 −8 javascript/libjoynr-js/src/main/js/joynr/provider/ProviderOperation.js
  32. +1 −1 javascript/libjoynr-js/src/main/js/joynr/proxy/BroadcastFilterParameters.js
  33. +4 −2 javascript/libjoynr-js/src/main/js/joynr/proxy/OnChangeSubscriptionQos.js
  34. +8 −5 javascript/libjoynr-js/src/main/js/joynr/proxy/OnChangeWithKeepAliveSubscriptionQos.js
  35. +7 −8 javascript/libjoynr-js/src/main/js/joynr/proxy/PeriodicSubscriptionQos.js
  36. +3 −3 javascript/libjoynr-js/src/main/js/joynr/proxy/ProxyAttribute.js
  37. +6 −12 javascript/libjoynr-js/src/main/js/joynr/proxy/ProxyBuilder.js
  38. +3 −4 javascript/libjoynr-js/src/main/js/joynr/proxy/ProxyEvent.js
  39. +8 −11 javascript/libjoynr-js/src/main/js/joynr/proxy/ProxyOperation.js
  40. +5 −3 javascript/libjoynr-js/src/main/js/joynr/proxy/SubscriptionQos.js
  41. +5 −5 javascript/libjoynr-js/src/main/js/joynr/start/InProcessRuntime.js
  42. +11 −12 javascript/libjoynr-js/src/main/js/joynr/start/InterTabClusterControllerRuntime.js
  43. +10 −10 javascript/libjoynr-js/src/main/js/joynr/start/InterTabLibjoynrRuntime.js
  44. +1 −3 javascript/libjoynr-js/src/main/js/joynr/start/TypeRegistry.js
  45. +7 −7 javascript/libjoynr-js/src/main/js/joynr/start/WebSocketLibjoynrRuntime.js
  46. +1 −1 javascript/libjoynr-js/src/main/js/joynr/start/settings/defaultClusterControllerSettings.js
  47. +1 −1 javascript/libjoynr-js/src/main/js/joynr/start/settings/defaultInterTabSettings.js
  48. +3 −3 javascript/libjoynr-js/src/main/js/joynr/system/JoynrLogger.js
  49. +4 −8 javascript/libjoynr-js/src/main/js/joynr/util/MethodUtil.js
  50. +11 −13 javascript/libjoynr-js/src/main/js/joynr/util/Typing.js
  51. +8 −7 javascript/libjoynr-js/src/test/js/global/JoynrPersistTest.js
  52. +8 −7 javascript/libjoynr-js/src/test/js/global/LocalStorageNodeTest.js
  53. +1 −1 javascript/libjoynr-js/src/test/js/global/LocalStorageNodeTests.js
  54. +2 −6 javascript/libjoynr-js/src/test/js/joynr/capabilities/CapabilitiesRegistrarTest.js
  55. +1 −1 javascript/libjoynr-js/src/test/js/joynr/capabilities/ParticipantIdStorageTest.js
  56. +2 −2 javascript/libjoynr-js/src/test/js/joynr/capabilities/arbitration/ArbitratorTest.js
  57. +6 −6 javascript/libjoynr-js/src/test/js/joynr/capabilities/discovery/CapabilityDiscoveryTest.js
  58. +3 −3 javascript/libjoynr-js/src/test/js/joynr/dispatching/DispatcherTest.js
  59. +5 −6 javascript/libjoynr-js/src/test/js/joynr/dispatching/RequestReplyManagerTest.js
  60. +7 −7 javascript/libjoynr-js/src/test/js/joynr/dispatching/TtlUpliftTest.js
  61. +15 −15 javascript/libjoynr-js/src/test/js/joynr/dispatching/subscription/PublicationManagerTest.js
  62. +7 −7 javascript/libjoynr-js/src/test/js/joynr/dispatching/subscription/SubscriptionManagerTest.js
  63. +18 −27 javascript/libjoynr-js/src/test/js/joynr/dispatching/subscription/SubscriptionUtilTest.js
  64. +6 −6 javascript/libjoynr-js/src/test/js/joynr/messaging/JoynrMessageTest.js
  65. +1 −1 javascript/libjoynr-js/src/test/js/joynr/messaging/MessagingQosTest.js
  66. +1 −1 javascript/libjoynr-js/src/test/js/joynr/messaging/mqtt/MqttMessagingStubTest.js
  67. +3 −3 javascript/libjoynr-js/src/test/js/joynr/messaging/routing/MessageQueueTest.js
  68. +10 −10 javascript/libjoynr-js/src/test/js/joynr/messaging/routing/MessageRouterTest.js
  69. +1 −1 javascript/libjoynr-js/src/test/js/joynr/messaging/routing/ParticipantQueueTest.js
  70. +1 −1 javascript/libjoynr-js/src/test/js/joynr/proxy/ProxyOperationTest.js
  71. +1 −1 javascript/libjoynr-js/src/test/js/joynr/start/InProcessRuntimeTest.js
  72. +1 −1 javascript/libjoynr-js/src/test/js/joynr/start/WebSocketLibjoynrRuntimeTest.js
  73. +3 −3 javascript/libjoynr-js/src/test/js/joynr/system/JoynrLoggerTest.js
  74. +1 −1 javascript/libjoynr-js/src/test/js/joynr/util/JSONSerializerTest.js
  75. +6 −6 javascript/libjoynr-js/src/test/js/joynr/util/LongTimerTest.js
  76. +2 −2 javascript/libjoynr-js/src/test/js/joynr/util/TypingTest.js
  77. +3 −3 javascript/libjoynr-js/src/test/js/joynr/util/UtilTest.js
  78. +1 −1 javascript/libjoynr-js/src/test/js/node-unit-test-helper.js
  79. +1 −1 javascript/libjoynr-js/src/test/js/node_integration/ChildProcessUtils.js
  80. +11 −13 javascript/libjoynr-js/src/test/js/node_integration/End2EndAbstractTest.js
  81. +1 −1 javascript/libjoynr-js/src/test/js/node_integration/End2EndDatatypesTest.js
  82. +2 −1 javascript/libjoynr-js/src/test/js/node_integration/End2EndRPCTest.js
  83. +10 −12 javascript/libjoynr-js/src/test/js/node_integration/End2EndSubscriptionTest.js
  84. +4 −4 javascript/libjoynr-js/src/test/js/node_integration/IntegrationUtils.js
  85. +3 −3 javascript/libjoynr-js/src/test/js/node_integration/LocalDiscoveryTest.js
  86. +7 −9 javascript/libjoynr-js/src/test/js/node_integration/TestEnd2EndCommProviderProcess.js
  87. +1 −1 javascript/libjoynr-js/src/test/js/node_integration/TestEnd2EndDatatypesProviderProcess.js
@@ -72,6 +72,7 @@ module.exports = {
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": "off",
"prefer-template": "error",
"prefer-spread": "error",
"promise/always-return": "off",
"promise/no-return-wrap": "error",
@@ -76,8 +76,9 @@ JoynrPersist.prototype = {
return fs.lstatSync(filePath).isDirectory();
});
throw new Error(
"joynr configuration error: Persistency subdirectory must not include other subdirectories. Directories found: " +
JSON.stringify(subDirectories)
`joynr configuration error: Persistency subdirectory must not include other subdirectories. Directories found: ${JSON.stringify(
subDirectories
)}`
);
} else {
throw e;
@@ -88,7 +88,7 @@ if (global.window !== undefined) {
},
_wrapFunction(cb, ...args) {
this._promiseChain = this._promiseChain.then(() => cb(...args)).catch(e => {
log.error(`failure executing ${cb} with args ${JSON.stringify(args)} error: ` + e);
log.error(`failure executing ${cb} with args ${JSON.stringify(args)} error: ${e}`);
});
}
};
@@ -30,7 +30,7 @@ if (typeof TextDecoder !== "function") {
const log = LoggingManager.getLogger("joynr.messaging.websocket.WebSocket");
const fileReader = new FileReader();
fileReader.onError = function(error) {
log.error("Decoding of binary message failed: " + error);
log.error(`Decoding of binary message failed: ${error}`);
};
const textDecoder = new TextDecoder();
const textEncoder = new TextEncoder();
@@ -144,7 +144,7 @@ CapabilitiesRegistrar.prototype.registerProvider = function registerProvider(

if (missingImplementations.length > 0) {
throw new Error(
"provider: " + domain + "/" + provider.interfaceName + " is missing: " + missingImplementations.toString()
`provider: ${domain}/${provider.interfaceName} is missing: ${missingImplementations.toString()}`
);
}

@@ -192,12 +192,9 @@ CapabilitiesRegistrar.prototype.registerProvider = function registerProvider(

function registerProviderFinished() {
log.info(
"Provider registered: participantId: " +
participantId +
", domain: " +
domain +
", interfaceName: " +
`Provider registered: participantId: ${participantId}, domain: ${domain}, interfaceName: ${
provider.interfaceName
}`
);
return participantId;
}
@@ -237,12 +234,9 @@ CapabilitiesRegistrar.prototype.unregisterProvider = function unregisterProvider

return Promise.all([discoveryStubPromise, messageRouterPromise]).then(() => {
log.info(
"Provider unregistered: participantId: " +
participantId +
", domain: " +
domain +
", interfaceName: " +
`Provider unregistered: participantId: ${participantId}, domain: ${domain}, interfaceName: ${
provider.interfaceName
}`
);
});
};
@@ -43,7 +43,7 @@ function ParticipantIdStorage(persistency, uuid) {
* @returns {String} the retrieved or generated participantId
*/
ParticipantIdStorage.prototype.getParticipantId = function getParticipantId(domain, provider) {
const key = "joynr.participant." + domain + "." + provider.interfaceName;
const key = `joynr.participant.${domain}.${provider.interfaceName}`;
let participantId = this._persistency.getItem(key);
if (!participantId) {
participantId = this._uuid();
@@ -66,7 +66,7 @@ function discoverStaticCapabilities(capabilities, domains, interfaceName, discov
}
} catch (e) {
deferred.pending = false;
deferred.reject(new Error("Exception while arbitrating: " + e));
deferred.reject(new Error(`Exception while arbitrating: ${e}`));
}
}

@@ -245,14 +245,9 @@ Arbitrator.prototype.startArbitration = function startArbitration(settings) {
delete that._pendingArbitrations[deferred.id];

if (deferred.incompatibleVersionsFound.length > 0) {
const message =
'no compatible provider found within discovery timeout for domains "' +
JSON.stringify(settings.domains) +
'", interface "' +
settings.interfaceName +
'" with discoveryQos "' +
JSON.stringify(settings.discoveryQos) +
'"';
const message = `no compatible provider found within discovery timeout for domains "${JSON.stringify(
settings.domains
)}", interface "${settings.interfaceName}" with discoveryQos "${JSON.stringify(settings.discoveryQos)}"`;
startArbitrationDeferred.reject(
new NoCompatibleProviderFoundException({
detailMessage: message,
@@ -263,15 +258,11 @@ Arbitrator.prototype.startArbitration = function startArbitration(settings) {
} else {
startArbitrationDeferred.reject(
new DiscoveryException({
detailMessage:
'no provider found within discovery timeout for domains "' +
JSON.stringify(settings.domains) +
'", interface "' +
settings.interfaceName +
'" with discoveryQos "' +
JSON.stringify(settings.discoveryQos) +
'"' +
(deferred.errorMsg !== undefined ? ". Error: " + deferred.errorMsg : "")
detailMessage: `no provider found within discovery timeout for domains "${JSON.stringify(
settings.domains
)}", interface "${settings.interfaceName}" with discoveryQos "${JSON.stringify(
settings.discoveryQos
)}"${deferred.errorMsg !== undefined ? `. Error: ${deferred.errorMsg}` : ""}`
})
);
}
@@ -121,7 +121,7 @@ function CapabilityDiscovery(
})
})
.catch(error => {
throw new Error("Failed to create global capabilities directory proxy: " + error);
throw new Error(`Failed to create global capabilities directory proxy: ${error}`);
});
}

@@ -149,8 +149,9 @@ function CapabilityDiscovery(
globalAddress = Typing.augmentTypes(JSON.parse(globalDiscoveryEntry.address));
} catch (e) {
log.error(
"unable to use global discoveryEntry with unknown address type: " +
`unable to use global discoveryEntry with unknown address type: ${
globalDiscoveryEntry.address
}`
);
continue;
}
@@ -221,7 +222,7 @@ function CapabilityDiscovery(
});
})
.catch(error => {
throw new Error('Error calling operation "add" of GlobalCapabilitiesDirectory because: ' + error);
throw new Error(`Error calling operation "add" of GlobalCapabilitiesDirectory because: ${error}`);
});
}

@@ -363,7 +364,7 @@ function CapabilityDiscovery(
}
return lookupGlobalCapabilities(domains, interfaceName, TTL_30DAYS_IN_MS, globalCapabilities);
default:
log.error("unknown discoveryScope value: " + discoveryQos.discoveryScope.value);
log.error(`unknown discoveryScope value: ${discoveryQos.discoveryScope.value}`);
}
};

@@ -409,9 +410,7 @@ function CapabilityDiscovery(
promise = addGlobal(discoveryEntry);
}
} else {
promise = Promise.reject(
new Error('Encountered unknown ProviderQos scope "' + discoveryEntry.qos.scope + '"')
);
promise = Promise.reject(new Error(`Encountered unknown ProviderQos scope "${discoveryEntry.qos.scope}"`));
}
return promise;
};
@@ -431,7 +430,7 @@ function CapabilityDiscovery(
return globalCapabilitiesDirectoryProxy.touch({ clusterControllerId });
})
.catch(error => {
throw new Error('Error calling operation "touch" of GlobalCapabilitiesDirectory because: ' + error);
throw new Error(`Error calling operation "touch" of GlobalCapabilitiesDirectory because: ${error}`);
});
};

@@ -454,7 +453,7 @@ function CapabilityDiscovery(
});
})
.catch(error => {
throw new Error('Error calling operation "remove" of GlobalCapabilitiesDirectory because: ' + error);
throw new Error(`Error calling operation "remove" of GlobalCapabilitiesDirectory because: ${error}`);
});
}

@@ -481,9 +480,9 @@ function CapabilityDiscovery(
});
if (discoveryEntries === undefined || discoveryEntries.length !== 1) {
log.warn(
"remove(): no capability entry found in local capabilities store for participantId " +
participantId +
". Trying to remove the capability from global directory"
`remove(): no capability entry found in local capabilities store for participantId ${
participantId
}. Trying to remove the capability from global directory`
);
promise = removeParticipantIdFromGlobalCapabilitiesDirectory(participantId);
} else if (discoveryEntries[0].qos.scope === ProviderScope.LOCAL || discoveryEntries.length < 1) {
@@ -492,7 +491,7 @@ function CapabilityDiscovery(
promise = removeParticipantIdFromGlobalCapabilitiesDirectory(participantId);
} else {
promise = Promise.reject(
new Error('Encountered unknown ProviderQos scope "' + discoveryEntries[0].qos.scope + '"')
new Error(`Encountered unknown ProviderQos scope "${discoveryEntries[0].qos.scope}"`)
);
}
return promise;
Oops, something went wrong.

0 comments on commit 4a8e97b

Please sign in to comment.
You can’t perform that action at this time.