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

function with for...in or for...of removed during tree-shaking #870

Closed
Zirro opened this issue Aug 20, 2016 · 2 comments
Closed

function with for...in or for...of removed during tree-shaking #870

Zirro opened this issue Aug 20, 2016 · 2 comments

Comments

@Zirro
Copy link

Zirro commented Aug 20, 2016

I've extracted a minimal testcase that reproduces the issue in Rollup 0.34.9:

const items = document.querySelector('.items');

function sayHello() {
  for (const item of items.children) {
    item.textContent = 'Hello!';
  }
}

sayHello();

The function remains after tree-shaking if I remove the loop but keep the .textContent-line, or add more code such as a console.log() into it.

@Zirro
Copy link
Author

Zirro commented Aug 21, 2016

Having looked at issue #786, I believe the cause might be the same. Feel free to close this issue as a dupe if you can verify that this is the case.

@Rich-Harris
Copy link
Contributor

Sorry for the delay – fixed in 0.35.4

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

No branches or pull requests

2 participants