mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address CR
This commit is contained in:
@@ -11924,8 +11924,8 @@ module ts {
|
||||
|
||||
// GRAMMAR CHECKING
|
||||
function isReservedwordInStrictMode(node: Identifier): boolean {
|
||||
// Check that originalStrictModeSyntaxKind is less than LastFurtureReservedWord to see if an Identifier is a strict-mode reserved word
|
||||
return (node.parserContextFlags & ParserContextFlags.StrictMode) && node.originalStrictModeSyntaxKind <= SyntaxKind.LastFutureReservedWord;
|
||||
// Check that originalKeywordKind is less than LastFurtureReservedWord to see if an Identifier is a strict-mode reserved word
|
||||
return (node.parserContextFlags & ParserContextFlags.StrictMode) && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord;
|
||||
}
|
||||
|
||||
function reportStrictModeGrammarErrorInClassDeclaration(identifier: Identifier, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean {
|
||||
@@ -11945,7 +11945,7 @@ module ts {
|
||||
let nameBindings = impotClause.namedBindings;
|
||||
if (nameBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
let name = <Identifier>(<NamespaceImport>nameBindings).name;
|
||||
if (name.originalStrictModeSyntaxKind) {
|
||||
if (name.originalKeywordKind) {
|
||||
let nameText = declarationNameToString(name);
|
||||
return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
@@ -11954,7 +11954,7 @@ module ts {
|
||||
let reportError = false;
|
||||
for (let element of (<NamedImports>nameBindings).elements) {
|
||||
let name = element.name;
|
||||
if (name.originalStrictModeSyntaxKind) {
|
||||
if (name.originalKeywordKind) {
|
||||
let nameText = declarationNameToString(name);
|
||||
reportError = reportError || grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
|
||||
@@ -1489,7 +1489,7 @@ module ts {
|
||||
|
||||
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
||||
if (token !== SyntaxKind.Identifier) {
|
||||
node.originalStrictModeSyntaxKind = token;
|
||||
node.originalKeywordKind = token;
|
||||
}
|
||||
node.text = internIdentifier(scanner.getTokenValue());
|
||||
nextToken();
|
||||
|
||||
@@ -387,7 +387,7 @@ module ts {
|
||||
|
||||
export interface Identifier extends PrimaryExpression {
|
||||
text: string; // Text of identifier (with escapes converted to characters)
|
||||
originalStrictModeSyntaxKind?: SyntaxKind; // Original syntaxKind which get set so that we can report an error later
|
||||
originalKeywordKind?: SyntaxKind; // Original syntaxKind which get set so that we can report an error later
|
||||
}
|
||||
|
||||
export interface QualifiedName extends Node {
|
||||
|
||||
Reference in New Issue
Block a user