From d5bdc1600b9c374b95ce4b687c257391ada8e4a7 Mon Sep 17 00:00:00 2001 From: t4skforce <7422037+t4skforce@users.noreply.github.com> Date: Tue, 31 Jul 2018 22:54:15 +0200 Subject: [PATCH] fixed some linting issues * added some semicolons * removed double parsing of ```err.stack``` into ```var stack``` --- nodes/core/core/80-function.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/nodes/core/core/80-function.js b/nodes/core/core/80-function.js index 7edb6c4a8..931958c7b 100644 --- a/nodes/core/core/80-function.js +++ b/nodes/core/core/80-function.js @@ -42,7 +42,7 @@ module.exports = function(RED) { if (type === 'object') { type = Buffer.isBuffer(msg)?'Buffer':(util.isArray(msg)?'Array':'Date'); } - node.error(RED._("function.error.non-message-returned",{ type: type })) + node.error(RED._("function.error.non-message-returned",{ type: type })); } } } @@ -203,9 +203,9 @@ module.exports = function(RED) { if (util.hasOwnProperty('promisify')) { sandbox.setTimeout[util.promisify.custom] = function(after, value) { return new Promise(function(resolve, reject) { - sandbox.setTimeout(function(){ resolve(value) }, after); + sandbox.setTimeout(function(){ resolve(value); }, after); }); - } + }; } var context = vm.createContext(sandbox); try { @@ -241,7 +241,6 @@ module.exports = function(RED) { var line = 0; var errorMessage; - var stack = err.stack.split(/\r?\n/); if (stack.length > 0) { while (line < stack.length && stack[line].indexOf("ReferenceError") !== 0) { line++; @@ -265,13 +264,13 @@ module.exports = function(RED) { }); this.on("close", function() { while (node.outstandingTimers.length > 0) { - clearTimeout(node.outstandingTimers.pop()) + clearTimeout(node.outstandingTimers.pop()); } while (node.outstandingIntervals.length > 0) { - clearInterval(node.outstandingIntervals.pop()) + clearInterval(node.outstandingIntervals.pop()); } this.status({}); - }) + }); } catch(err) { // eg SyntaxError - which v8 doesn't include line number information // so we can't do better than this @@ -280,4 +279,4 @@ module.exports = function(RED) { } RED.nodes.registerType("function",FunctionNode); RED.library.register("functions"); -} +};