-
Notifications
You must be signed in to change notification settings - Fork 64
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
api: fallback to anonymous function #38
Conversation
Cool! Now the second step is to detect whether we are running in environment without |
How about this? |
Yay! Exactly! |
'})'); | ||
var named; | ||
try { | ||
named = require('vm').runInThisContext('(function ' + this.name + '(entity) {\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask you to preserve the 80 column limit that I had here? ;)
Just one minor nit, otherwise LGTM! Thank you! |
(Assuming it works for you ;) ) |
`vm-browserify` uses `eval()` which is disabled in Chrome Apps (completely) and Extensions (by default CSP). If can't execute `vm.runInThisContext` to create named function, fallback to unnamed function expression.
Thank you! Landed and released! |
vm-browserify
useseval()
which is disabled in Chrome Apps (completely)and Extensions (by default CSP). If can't execute
vm.runInThisContext
to create named function, fallback to unnamed function expression.