-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
IIFE should never be negated when it is the program completion value #628
Comments
Could you describe a case in which it is vital to preserve program completion value? |
What is IIFR? |
You probably mean iife - though these shortcuts are really meaningless in my opinion... |
Oops, yes, I meant IFFE, my bad! Apparently, I've been overexposed these days seeing IFFR everywhere which stands for International Film Festival Rotterdam. :-) When is the program completion value vital?
Or in general, when using the compressed output in any way as an expression, for instance: |
Closing in favor of #640. |
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
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
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
See issues #625 and #627.
Two workarounds are possible to prevent the issue:
One way is to use the option
negate_iife:false
, the other is to prepend the IIFE with0;
combined with the optionside_effects:false
.Neither of which is ideal for the overall compression.
In order to fix this bug, an IIFE should never be negated when it is the program completion value.
The text was updated successfully, but these errors were encountered: