Skip to content
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

Avoid eval #1403

Closed
jathri opened this issue Apr 16, 2017 · 4 comments
Closed

Avoid eval #1403

jathri opened this issue Apr 16, 2017 · 4 comments

Comments

@jathri
Copy link

jathri commented Apr 16, 2017

Hello!
I would like to ask if you can avoid using eval. I am getting this error from Firefox browser console:
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src moz-extension://...”). Source: call to eval() or related function blocked by CSP.
async.js:206

@aearly
Copy link
Collaborator

aearly commented Apr 16, 2017

If you can find a workaround for our use of eval I would be very interested:

https://github.com/caolan/async/blob/master/lib/internal/wrapAsync.js#L6-L15

@ex1st
Copy link

ex1st commented Apr 17, 2017

@aearly why not to change:

function isAsync(fn) {
    return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
}

to

function isAsync(fn) {
   return fn.constructor.name === 'AsyncFunction';
}

megawac added a commit that referenced this issue Apr 17, 2017
Avoid eval in async wrappers; fixes #1403
@aearly
Copy link
Collaborator

aearly commented Apr 29, 2017

Released in v2.4.0!

@jathri
Copy link
Author

jathri commented May 2, 2017

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants