[...] V8 has "--use_strict" command line flag which enables strict mode globally, but we want to enforce strict mode only on worker scripts. Is there any way to achieve this?
Or, would it need a change such as adding an option parameter to ScriptCompiler::Compile()? [...]
On Mon, Sep 22, 2014 at 8:16 AM, <ksak...@chromium.org> wrote:[...] V8 has "--use_strict" command line flag which enables strict mode globally, but we want to enforce strict mode only on worker scripts. Is there any way to achieve this?Currently, no: All our flags are global variables, and the web workers live in the same process as the "normal" v8 Isolate, so all share the same set of flags.Or, would it need a change such as adding an option parameter to ScriptCompiler::Compile()? [...]Instead of hacking an ad-hoc parameter into that API entry, we should make our global flags an object which gets passed to Isolate::New. This would not be hard, but quite some (mechanical) work. Any takers? :-)
If you are really in a hurry, perhaps injecting some "use strict" before the actual code might work, too. (?)
--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/njXnLxmTKeo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.