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

Get rid of new Function #31

Merged
merged 1 commit into from
Nov 13, 2017
Merged

Get rid of new Function #31

merged 1 commit into from
Nov 13, 2017

Conversation

mourner
Copy link
Collaborator

@mourner mourner commented Sep 7, 2016

It was not necessary, because the created function was never called and immediately stringified afterwards for the blob.

Enables using webworkify in environments where CSP allows creating blobs but bans eval.

cc @anandthakker

@anandthakker
Copy link
Collaborator

Interesting -- I wonder why it used Function previously; is there any chance that the stringification varies by platform/browser? (cc @substack )

@mourner
Copy link
Collaborator Author

mourner commented Sep 7, 2016

@anandthakker it shouldn't vary since it's standardized. And I don't think webworkify relies on a string -> function -> string conversion in any meaningful way.

@anandthakker
Copy link
Collaborator

cool, I'm sold

@mourner
Copy link
Collaborator Author

mourner commented Sep 7, 2016

One thing that may be affected is browserify's sources object (5-th argument), which will be augmented. It probably doesn't matter though because generated modules are never used anywhere else. If they do, we can change the behavior so that sources remains untouched.

@anandthakker
Copy link
Collaborator

Tested this locally and it looks good. Merging.

@anandthakker anandthakker merged commit 9c005a7 into browserify:master Nov 13, 2017
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 this pull request may close these issues.

2 participants