@node-red/nodes
Advanced tools
Comparing version 4.0.0-beta.2 to 4.0.0-beta.3
@@ -377,3 +377,3 @@ /** | ||
} | ||
node.script = vm.createScript(functionText, createVMOpt(node, "")); | ||
node.script = new vm.Script(functionText, createVMOpt(node, "")); | ||
if (node.fin && (node.fin !== "")) { | ||
@@ -442,6 +442,5 @@ var finText = `(function () { | ||
msg.error = err; | ||
var line = 0; | ||
var errorMessage; | ||
if (stack.length > 0) { | ||
let line = 0; | ||
let errorMessage; | ||
while (line < stack.length && stack[line].indexOf("ReferenceError") !== 0) { | ||
@@ -460,7 +459,9 @@ line++; | ||
} | ||
if (errorMessage) { | ||
err.message = errorMessage | ||
} | ||
} | ||
if (!errorMessage) { | ||
errorMessage = err.toString(); | ||
} | ||
done(errorMessage); | ||
// Pass the whole error object so any additional properties | ||
// (such as cause) are preserved | ||
done(err); | ||
} | ||
@@ -467,0 +468,0 @@ else if (typeof err === "string") { |
@@ -23,2 +23,3 @@ /** | ||
var isUtf8 = require('is-utf8'); | ||
const isWindows = process.platform === 'win32' | ||
@@ -89,5 +90,8 @@ function ExecNode(n) { | ||
var cmd = arg.shift(); | ||
// Since 18.20.2/20.12.2, it is invalid to call spawn on Windows with a .bat/.cmd file | ||
// without using shell: true. | ||
const opts = isWindows ? { ...node.spawnOpt, shell: true } : node.spawnOpt | ||
/* istanbul ignore else */ | ||
node.debug(cmd+" ["+arg+"]"); | ||
child = spawn(cmd,arg,node.spawnOpt); | ||
child = spawn(cmd,arg,opts); | ||
node.status({fill:"blue",shape:"dot",text:"pid:"+child.pid}); | ||
@@ -94,0 +98,0 @@ var unknownCommand = (child.pid === undefined); |
{ | ||
"name": "@node-red/nodes", | ||
"version": "4.0.0-beta.2", | ||
"version": "4.0.0-beta.3", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2843321
608
28023