You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the source through minify-guarded-expressions separately (babel --plugins=minify-guarded-expressions) it has no effect.
However when I run minify-simplify and minify-guarded-expressions at the same time (babel --plugins=minify-guarded-expressions,minify-simplify) I get this:
Yeah, we should be smarter here. If the value is utilized (passed to function, assigned, returned, etc.) probably need to ignore this optimization entirely.
I've distilled my repro case to this:
Notice that the function only returns
true
ifbar == 'spam'
.When I run it through
minify-simplify
plugin (babel --plugins=minify-simplify
) it produces a correct result:When I run the source through
minify-guarded-expressions
separately (babel --plugins=minify-guarded-expressions
) it has no effect.However when I run
minify-simplify
andminify-guarded-expressions
at the same time (babel --plugins=minify-guarded-expressions,minify-simplify
) I get this:Notice that the function now returns
true
for all the cases, not just'spam'
.Here's a REPL
The text was updated successfully, but these errors were encountered: