Suppose you have script A: defines a library with:
class MathFunctions { add(a, b) => { return a+b; } }
And you have script B: reuses MathFunctions somehow:
const mf = import MathFunctions;
console.log(mf.add(2, 2));
And you want to execute B in vm context, importing A.
What is the best way to do this with untrusted code?
Similar question here: https://github.com/patriksimek/vm2/issues/121