vm-browserify
vm-browserify copied to clipboard
require('vm') like in node but for the browser
- Used persistent iframe in order to support evaluating closures. - Added support for isContext method.
In node vm: ``` javascript var c = vm.createContext({}); vm.runInContext('Array.foo = 1', c); assert(1 === vm.runInContext('Array.foo')); ``` And that's not the case in this module because it disposes of iframe...
`eval` in an `iframe` context doesn't seem to work right now. May be related to this: https://code.google.com/p/chromium/issues/detail?id=412173
Using an iframe make it impossible to use in webworker