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

Content Security Policy and new Function(...) #123

Closed
saambarati opened this issue Sep 5, 2014 · 4 comments
Closed

Content Security Policy and new Function(...) #123

saambarati opened this issue Sep 5, 2014 · 4 comments

Comments

@saambarati
Copy link

When using a strict content security policy, using acorn will throw an exception when it calls makePredicate because it uses the Function constructor.

Here is a test case:
`

<script src="acorn.js></script>

`

@saambarati
Copy link
Author

One possible solution is to inline the results of makePredicate instead of computing it dynamically when acorn runs.

@RReverser
Copy link
Member

Some discussion on this was already in #90.

@RReverser
Copy link
Member

See #90 (comment).

@marijnh
Copy link
Member

marijnh commented Sep 12, 2014

I've pushed 91911bc and 0322beb to address this. You now get an acorn_csp.js file if you install from npm, which has the generated predicates pre-generated.

@marijnh marijnh closed this as completed Sep 12, 2014
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

Successfully merging a pull request may close this issue.

3 participants