Open amasad opened 10 years ago
Interesting. Closer inspection of node's context objects reveals that upon running something in a context the context object receives its own (non-enumerable) copy of every global, which is not identical with the current global.
I think the problem is that vm-browserify
only copies properties which were already on the context before the eval or were introduced by the eval'd code.
It seems very hard to match the exact behavior on both so I wrote a more simplified module: context-eval
it seems that the iframe disposal also prevents you from running async code inside a context, which breaks some stuff I wanted to do
In node vm:
And that's not the case in this module because it disposes of iframe (real context) after each run.