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

dart2js and disallow unsafe eval changes #13547

Closed
sethladd opened this issue Sep 24, 2013 · 2 comments
Closed

dart2js and disallow unsafe eval changes #13547

sethladd opened this issue Sep 24, 2013 · 2 comments
Assignees
Labels
area-documentation Prefer using 'type-documentation' and a specific area label. closed-duplicate Closed in favor of an existing report type-task
Milestone

Comments

@sethladd
Copy link
Contributor

"The --disallow-unsafe-eval option has been removed. Instead, dart2js will produce a file called precompiled.js. This file complies to CSP script-src: 'self' restrictions."

@sethladd
Copy link
Contributor Author

See also this announcement:

We have removed the option '--disallow-unsafe-eval' from dart2js.

Who is affected?

Developers of Chrome extensions or developers who serve JavaScript code with a header Content-Security-Policy: script-src 'self'. This policy disallows using 'eval' and 'new Function' in JavaScript code.

How do I update my code?

Remove the option '--disallow-unsafe-eval' from your build scripts. The compiler will always generate two JavaScript output files:
out.js
out.precompiled.js
The second file is for CSP mode.

Why did this change happen?

This change was made to simplify the user experience (one less option), and to simplify the implementation of CSP mode in dart2js. This allowed us to support 'dart:mirrors' in CSP mode which wasn't supported before.

We have monitored test cycle times and benchmarks, and generating this additional file doesn't seem to have any measurable effect.

When will the change take effect?

This change is already landed in bleeding_edge, and should make it to the next stable build.

Where can I learn more?

If you're interested in learning more about CSP, see: http://developer.chrome.com/extensions/contentSecurityPolicy.html

If you want to learn how to parse a "CSP policy policy", see http://www.w3.org/TR/2012/CR-CSP-20121115/#parsing

@sethladd
Copy link
Contributor Author

sethladd commented Dec 4, 2013

Set owner to @kwalrath.
Added this to the 1.1 milestone.
Added Duplicate label.
Marked as being merged into #9987.

@sethladd sethladd added type-task Priority-Unassigned area-documentation Prefer using 'type-documentation' and a specific area label. closed-duplicate Closed in favor of an existing report labels Dec 4, 2013
@sethladd sethladd added this to the 1.1 milestone Dec 4, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-documentation Prefer using 'type-documentation' and a specific area label. closed-duplicate Closed in favor of an existing report type-task
Projects
None yet
Development

No branches or pull requests

3 participants