This commit is contained in:
Divy Srivastava 2024-03-18 18:08:10 +05:30
parent 575513e056
commit 0d34a40acc

12
a.mjs
View File

@ -1,12 +0,0 @@
import vm from "node:vm";
globalThis.globalVar = 3;
const context = { globalVar: 1 };
vm.createContext(context);
vm.runInContext("globalVar *= 2;", context);
console.log(context);
console.log(global.globalVar);