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"); -} +};