Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

minify-guarded-expressions is too agressive #174

Closed
asapach opened this issue Oct 4, 2016 · 1 comment · Fixed by #179
Closed

minify-guarded-expressions is too agressive #174

asapach opened this issue Oct 4, 2016 · 1 comment · Fixed by #179

Comments

@asapach
Copy link

asapach commented Oct 4, 2016

Input:

foo = (bar.baz || '').length;

Output with minify-guarded-expressions enabled:

foo = bar.baz.length;

The problem is that bar.baz can be undefined, so bar.baz.length will throw an error.

For some reason I can't reproduce it on the REPL page, but it is reproducible via CLI: babel --plugins=minify-guarded-expressions

@boopathi
Copy link
Member

boopathi commented Oct 5, 2016

Related: #171

boopathi added a commit that referenced this issue Oct 5, 2016
kangax pushed a commit that referenced this issue Oct 5, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants