Skip to content

Commit b7c4d0a

Browse files
Fixed checks to use isReservedNameInStrictMode.
1 parent ddeb8bc commit b7c4d0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12016,7 +12016,7 @@ module ts {
1201612016
function isReservedWordInStrictMode(node: Identifier): boolean {
1201712017
// Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word
1201812018
return (node.parserContextFlags & ParserContextFlags.StrictMode) &&
12019-
(node.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
12019+
(SyntaxKind.FirstFutureReservedWord <= node.originalKeywordKind && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
1202012020
}
1202112021

1202212022
function reportStrictModeGrammarErrorInClassDeclaration(identifier: Identifier, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean {
@@ -12036,7 +12036,7 @@ module ts {
1203612036
let nameBindings = impotClause.namedBindings;
1203712037
if (nameBindings.kind === SyntaxKind.NamespaceImport) {
1203812038
let name = <Identifier>(<NamespaceImport>nameBindings).name;
12039-
if (name.originalKeywordKind) {
12039+
if (isReservedWordInStrictMode(name)) {
1204012040
let nameText = declarationNameToString(name);
1204112041
return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
1204212042
}
@@ -12045,7 +12045,7 @@ module ts {
1204512045
let reportError = false;
1204612046
for (let element of (<NamedImports>nameBindings).elements) {
1204712047
let name = element.name;
12048-
if (name.originalKeywordKind) {
12048+
if (isReservedWordInStrictMode(name)) {
1204912049
let nameText = declarationNameToString(name);
1205012050
reportError = reportError || grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
1205112051
}

0 commit comments

Comments
 (0)