Skip to content

Commit

Permalink
replace vm.createScript in favor of vm.Script
Browse files Browse the repository at this point in the history
  • Loading branch information
patlux committed Jan 21, 2024
1 parent a587655 commit ec062d0
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ module.exports = function(RED) {
var acorn = require("acorn");
var acornWalk = require("acorn-walk");

if (vm.createScript == null) {
vm.createScript = (code, scriptName) => {
return new vm.Script(code, { filename: scriptName });
}
}

function sendResults(node,send,_msgid,msgs,cloneFirstMessage) {
if (msgs == null) {
return;
Expand Down Expand Up @@ -380,7 +374,7 @@ module.exports = function(RED) {
iniOpt.breakOnSigint = true;
}
}
node.script = vm.createScript(functionText, createVMOpt(node, ""));
node.script = vm.Script(functionText, {filename: createVMOpt(node, "")});
if (node.fin && (node.fin !== "")) {
var finText = `(function () {
var node = {
Expand Down

0 comments on commit ec062d0

Please sign in to comment.