Skip to content

Commit 06db35c

Browse files
Use early bail-out for contextual identifier checks.
1 parent ff92ab0 commit 06db35c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/compiler/binder.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,9 +2419,13 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
24192419

24202420
// strict mode identifiers
24212421
const originalKeywordKind = identifierToKeywordKind(node);
2422+
if (originalKeywordKind === undefined) {
2423+
return;
2424+
}
2425+
24222426
if (inStrictMode &&
2423-
originalKeywordKind! >= SyntaxKind.FirstFutureReservedWord &&
2424-
originalKeywordKind! <= SyntaxKind.LastFutureReservedWord) {
2427+
originalKeywordKind >= SyntaxKind.FirstFutureReservedWord &&
2428+
originalKeywordKind <= SyntaxKind.LastFutureReservedWord) {
24252429
file.bindDiagnostics.push(createDiagnosticForNode(node,
24262430
getStrictModeIdentifierMessage(node), declarationNameToString(node)));
24272431
}

0 commit comments

Comments
 (0)