commonjs wrapper / get rid of globals
Opened this issue · 0 comments
bmeck commented
probably just going to wrap in a different context for first iteration, i can take the issue that far at least. This will have primitives not matching outer context though (which is fine for first iteration).
cajaVM should not be a global, and should have a per instance shared import cache.
API could be something like:
ses.createVM()
VMs need to provide:
exports.eval(code) // no way to set the sandbox?
exports.compileExpr(code, sandbox)
exports.compileModule(code)(sandbox)
exports.Function(args..., code)
Have prototype, reading up on caja stuff but docs are inline...