mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 20:25:23 -06:00
Fixed checks to use isReservedNameInStrictMode.
This commit is contained in:
parent
ddeb8bcafc
commit
b7c4d0a28e
@ -12016,7 +12016,7 @@ module ts {
|
||||
function isReservedWordInStrictMode(node: Identifier): boolean {
|
||||
// Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word
|
||||
return (node.parserContextFlags & ParserContextFlags.StrictMode) &&
|
||||
(node.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
|
||||
(SyntaxKind.FirstFutureReservedWord <= node.originalKeywordKind && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
|
||||
}
|
||||
|
||||
function reportStrictModeGrammarErrorInClassDeclaration(identifier: Identifier, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean {
|
||||
@ -12036,7 +12036,7 @@ module ts {
|
||||
let nameBindings = impotClause.namedBindings;
|
||||
if (nameBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
let name = <Identifier>(<NamespaceImport>nameBindings).name;
|
||||
if (name.originalKeywordKind) {
|
||||
if (isReservedWordInStrictMode(name)) {
|
||||
let nameText = declarationNameToString(name);
|
||||
return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
@ -12045,7 +12045,7 @@ module ts {
|
||||
let reportError = false;
|
||||
for (let element of (<NamedImports>nameBindings).elements) {
|
||||
let name = element.name;
|
||||
if (name.originalKeywordKind) {
|
||||
if (isReservedWordInStrictMode(name)) {
|
||||
let nameText = declarationNameToString(name);
|
||||
reportError = reportError || grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user