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

Preserve program completion value with enable_iife enabled #1293

Closed

Conversation

rvanvelzen
Copy link
Collaborator

Fix #640

@kzc
Copy link
Contributor

kzc commented Sep 16, 2016

IIFEs are not the only constructs changed by uglify that would effect the completion value.

#543 (comment)

If uglify does not preserve the completion value in the general case, why do it here?

@kzc
Copy link
Contributor

kzc commented Sep 16, 2016

It would be nice to have a compress option that could be disabled for standalone JS to not have this behavior. -c completion_values=false or whatever.

@kzc
Copy link
Contributor

kzc commented Sep 17, 2016

Nix my comments above. I'm good with this PR. But in light of the discussion in #640 I think the compress default should be negate_iife=false.

@alexlamsl alexlamsl mentioned this pull request Jan 30, 2017
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this pull request Mar 1, 2017
Things like Angular Expression and Bookmarklet do not specify `return`, but implicitedly assumes the evaluated value from the final statement to be the return value.

fixes mishoo#354
fixes mishoo#543
fixes mishoo#625
fixes mishoo#628
fixes mishoo#640
closes mishoo#1293
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this pull request Mar 2, 2017
Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.

fixes mishoo#354
fixes mishoo#543
fixes mishoo#625
fixes mishoo#628
fixes mishoo#640
closes mishoo#1293
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this pull request Mar 3, 2017
Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.

fixes mishoo#354
fixes mishoo#543
fixes mishoo#625
fixes mishoo#628
fixes mishoo#640
closes mishoo#1293
alexlamsl added a commit that referenced this pull request Mar 3, 2017
Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.

fixes #354
fixes #543
fixes #625
fixes #628
fixes #640
closes #1293
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