Skip to content

Commit

Permalink
adding pollyfill for vm.createScript
Browse files Browse the repository at this point in the history
adds support for bun.sh
  • Loading branch information
patlux committed Jan 21, 2024
1 parent 5b096bf commit a587655
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ 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

0 comments on commit a587655

Please sign in to comment.