-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Disallow confusing combinations of !in and !instanceof #60628
base: main
Are you sure you want to change the base?
Disallow confusing combinations of !in and !instanceof #60628
Conversation
src/compiler/scanner.ts
Outdated
@@ -1967,7 +1967,18 @@ export function createScanner( | |||
} | |||
return pos += 2, token = SyntaxKind.ExclamationEqualsToken; | |||
} | |||
const hasLeadingWhitespace = charCodeChecked(pos - 1) === CharacterCodes.space; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like the right check; the character could be a tab or other character. I think we have a helper for this sort of check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks; you'll probably want a test with a tab in it just to verify.
@typescript-bot test it |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Fixes #60518
Disallows
!in
and!instanceof
sequences.