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:
		| @@ -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; | ||||
| @@ -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 = { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user