Skip to content

Conversation

rbuckton
Copy link
Contributor

@rbuckton rbuckton commented Jul 3, 2021

This adds a missing collision check for the global Reflect object when encountering a super reference in a static initializer in ES2015-ES2021.

The collision check isn't needed in <=ES5 for the following reasons:

  • We don't support uncalled SuperProperty access in <=ES5
  • We use _super in <= ES5
  • Reflect isn't available in ES5, so we do not use it as part of the transformation for targets below ES2015.

This also updates needCollisionCheckForIdentifier to avoid false positives for type-only imports.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 3, 2021
@rbuckton rbuckton requested a review from weswigham July 3, 2021 02:07
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One initial question and one suggestion. I'll look at the rest of checker.ts' changes tomorrow.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few small questions/formatting.

@rbuckton rbuckton force-pushed the reflect-collision-check branch from 8a2a23c to 8d802c3 Compare July 10, 2021 04:07
@rbuckton rbuckton force-pushed the reflect-collision-check branch from 8d802c3 to 3cce99a Compare July 10, 2021 19:17
@rbuckton rbuckton merged commit 66c3063 into main Jul 10, 2021
@rbuckton rbuckton deleted the reflect-collision-check branch July 10, 2021 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants