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

Treeshaking trying to evaluate non-constant expressions #2651

Closed
lishid opened this issue Jan 12, 2019 · 2 comments · Fixed by #2652
Closed

Treeshaking trying to evaluate non-constant expressions #2651

lishid opened this issue Jan 12, 2019 · 2 comments · Fixed by #2652

Comments

@lishid
Copy link

lishid commented Jan 12, 2019

  • Rollup Version: 1.1.0
  • Operating System (or Browser): Windows 10 x64
  • Node Version: 11.6.0

How Do We Reproduce?

if ({}.hasOwnProperty) {
  console.log(true);
} else {
  console.log(false);
}

REPL link

Expected Behavior

Output identical/similar to input

Actual Behavior

'use strict';

{
  console.log(false);
}
@lukastaegert
Copy link
Member

Thanks for spotting this, fix at #2652.

@lishid
Copy link
Author

lishid commented Jan 12, 2019

Thanks for the speedy fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants