-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use vm.runInThisContext instead of eval? #17
Comments
Thanks! Yes, I felt bad committing that code. I think |
I think it is a little safer than eval according to http://nodejs.org/api/vm.html#vm_vm_runinthiscontext_code_filename since it can't touch local variables.
|
Good point with the CSP, didn't consider that. I was fine with eval from a security perspective in this case because the coffee-script parser should guarantee those fields to be literals (e.g. no code involved). I would love for this code to run client-side but it looks like |
Fixes #17 While this gets rid of `eval` in node or in "mixed" environments like node-webkit or Atom Shell apps, it still resolves to eval when using browserify. For a solution that is compatible with CSP policies we'd need actual parsing of the literals (wish coffee-script would do it). See: * https://github.com/substack/vm-browserify/blob/bfd7c5f59edec856dc7efe0b77a4f6b2fa20f226/index.js#L105
v1.0.4 |
Has 1.0.4 been published yet to npmjs.org? |
Oops -> #19 Published to public registry. |
Awesome, thanks so much for this fix! |
Just wondering why
eval
is used overvm.runInThisContext
which is what CoffeeScript uses.The text was updated successfully, but these errors were encountered: