mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
replace vm.createScript in favor of vm.Script
This commit is contained in:
parent
a587655a5a
commit
ec062d008f
@ -22,12 +22,6 @@ module.exports = function(RED) {
|
|||||||
var acorn = require("acorn");
|
var acorn = require("acorn");
|
||||||
var acornWalk = require("acorn-walk");
|
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) {
|
function sendResults(node,send,_msgid,msgs,cloneFirstMessage) {
|
||||||
if (msgs == null) {
|
if (msgs == null) {
|
||||||
return;
|
return;
|
||||||
@ -380,7 +374,7 @@ module.exports = function(RED) {
|
|||||||
iniOpt.breakOnSigint = true;
|
iniOpt.breakOnSigint = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node.script = vm.createScript(functionText, createVMOpt(node, ""));
|
node.script = vm.Script(functionText, {filename: createVMOpt(node, "")});
|
||||||
if (node.fin && (node.fin !== "")) {
|
if (node.fin && (node.fin !== "")) {
|
||||||
var finText = `(function () {
|
var finText = `(function () {
|
||||||
var node = {
|
var node = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user