Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add post-compiler for CSP-safe version.
  • Loading branch information
RReverser committed Sep 12, 2014
1 parent 10553cb commit 4db1e8a
Show file tree
Hide file tree
Showing 4 changed files with 2,921 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -176,6 +176,14 @@ console.log(escodegen.generate(ast, {comment: true}));

[escodegen]: https://github.com/Constellation/escodegen

### acorn_csp.js ###

Acorn parser uses optimization techniques that involve dynamic code generation and compilation through `new Function`.

[Content Security Policy](http://www.html5rocks.com/en/tutorials/security/content-security-policy/#eval-too) disallows this by default for security purposes, so `acorn.js` can't work in CSP-enabled environment (see [#90](https://github.com/marijnh/acorn/issues/90) and [#123](https://github.com/marijnh/acorn/issues/123)).

For this cases, you should use `acorn_csp.js` which exposes same API as `acorn.js` but avoids usage of code generation in runtime.

### acorn_loose.js ###

This file implements an error-tolerant parser. It exposes a single
Expand Down

0 comments on commit 4db1e8a

Please sign in to comment.