// create 'myglobal' in global space:
(function(){myglobal='my global'})()
// access myglobal from eval - works
eval("console.log('1 myglobal='+myglobal)")
const vm = require('vm')
const script = new vm.Script("console.log('2 myglobal='+myglobal)");
// run script in the global context - works
script.runInThisContext()
// run the same script in a new context - fails:
script.runInNewContext()