Skip to content

Extending built-in Iterator class prevents tree-shaking #4310

@nathanielyoon

Description

@nathanielyoon

I'd expect --tree-shaking to eliminate this class if unused, but it doesn't.

class IteratorSubclass extends Iterator<number> {
  next() {
    return { value: 0 };
  }
}

This doesn't get rid of the unused class

Removing the extends works

Extending something else works

Could this have something to do with #3561?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions