Skip to content

Don’t create missing nodes for identifiers that would be valid in a newer script target #42520

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

Merged
merged 4 commits into from
Jan 29, 2021

Conversation

andrewbranch
Copy link
Member

Instead, put the invalid identifier text in the identifier node. (This is the same strategy we used to clean up the parse tree when private identifiers are used in places where private identifiers should never actually be parsed.)

Fixes one cause of #39854

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 27, 2021
Copy link
Member

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

Two questions, but nothing blocking.

if (isIdentifier) {
identifierCount++;
Copy link
Member

Choose a reason for hiding this comment

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

We only use identifierCount for diagnostics purposes. Is there a reason to make it conditional?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn’t think it was super important, but realized it was double-counting invalid identifiers, and it was easy to make it more accurate.

@andrewbranch andrewbranch merged commit 8523ca4 into microsoft:master Jan 29, 2021
@andrewbranch andrewbranch deleted the bug/39854 branch January 29, 2021 22:10
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.

4 participants