[nodejs] Re: Compiling JS for Safe vm.runInNewContext()

2012-07-15 Thread Rehan Iftikhar
I'm really happy to hear that other people are thinking about these types of solutions too. I really believe that there are a whole class of applications/services that take in user written Javascript to accomplish some higher goal (data processing, filtering, etc.) To that end I have been using

[nodejs] Re: Compiling JS for Safe vm.runInNewContext()

2012-07-11 Thread Jasvir Nagra
Missed the group reply. Hi Kevin, Specifically if you know you're in a ES5-strict mode compliant js engine, like a modern V8 to use this, load caja.js and initialize caja as follows: caja.initialize({ forceES5Mode: true }); caja.load(undefined /* if you don't need a dom */, caja.policy.net.ALL

[nodejs] Re: Compiling JS for Safe vm.runInNewContext()

2012-07-11 Thread Jeff Barczewski
https://github.com/tjanczuk/haiku-http is an interesting project that tries to provide a restartable/killable sandbox for running your code in node.js This could help in dealing with bad code and even infinite loops. I have not tried to use it yet, but flagged it as something I would look into