From 1dfd1b470ea9b65d707700e50db818fde1a3cca9 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 5 Feb 2015 16:19:04 -0800 Subject: [PATCH 01/12] initial version of parsing 'for-of' Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json --- src/compiler/checker.ts | 15 +++++++++ .../diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 6 +++- src/compiler/emitter.ts | 13 ++++++-- src/compiler/parser.ts | 32 +++++++++++++------ src/compiler/scanner.ts | 1 + src/compiler/types.ts | 10 ++++-- 7 files changed, 62 insertions(+), 16 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b9f8857cb23..caf07cbf4dc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8447,6 +8447,13 @@ module ts { checkSourceElement(node.statement); } + function checkForOfStatement(node: ForOfStatement) { + // TODO: not yet implemented + if (!checkGrammarForStatementInAmbientContext(node)) { + checkGrammarForOfStatement(node); + } + } + function checkForInStatement(node: ForInStatement) { // Grammar checking if (!checkGrammarForStatementInAmbientContext(node)) { @@ -9450,6 +9457,8 @@ module ts { return checkForStatement(node); case SyntaxKind.ForInStatement: return checkForInStatement(node); + case SyntaxKind.ForOfStatement: + return checkForOfStatement(node); case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: return checkBreakOrContinueStatement(node); @@ -10755,6 +10764,12 @@ module ts { } } + function checkGrammarForOfStatement(forOfStatement: ForOfStatement): boolean { + if (languageVersion < ScriptTarget.ES6) { + return grammarErrorOnFirstToken(forOfStatement, Diagnostics.For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); + } + } + function checkGrammarAccessor(accessor: MethodDeclaration): boolean { var kind = accessor.kind; if (languageVersion < ScriptTarget.ES5) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 2c64f8ff4b0..a661f53ddfc 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -313,6 +313,7 @@ module ts { Property_0_does_not_exist_on_const_enum_1: { code: 2475, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2476, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2477, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, + For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "For-of statements are only available when targeting ECMAScript 6 or higher" }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8299e9f7733..d59d4fe0d8e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1244,6 +1244,10 @@ "category": "Error", "code": 2477 }, + "For-of statements are only available when targeting ECMAScript 6 or higher": { + "category": "Error", + "code": 2482 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -1520,7 +1524,7 @@ "Exported type alias '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4081 - }, + }, "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6a2338268e8..8aa2fb72df3 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2911,7 +2911,7 @@ module ts { emitEmbeddedStatement(node.statement); } - function emitForInStatement(node: ForInStatement) { + function emitForInOrForOfStatement(node: ForInStatement | ForOfStatement) { var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); @@ -2932,7 +2932,13 @@ module ts { else { emit(node.initializer); } - write(" in "); + + if (node.kind === SyntaxKind.ForInStatement) { + write(" in "); + } + else { + write(" of "); + } emit(node.expression); emitToken(SyntaxKind.CloseParenToken, node.expression.end); emitEmbeddedStatement(node.statement); @@ -4351,8 +4357,9 @@ module ts { return emitWhileStatement(node); case SyntaxKind.ForStatement: return emitForStatement(node); + case SyntaxKind.ForOfStatement: case SyntaxKind.ForInStatement: - return emitForInStatement(node); + return emitForInOrForOfStatement(node); case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: return emitBreakOrContinueStatement(node); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 630418dc485..a90a4a9ab62 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1599,7 +1599,7 @@ module ts { // in the case where we're parsing the variable declarator of a 'for-in' statement, we // are done if we see an 'in' keyword in front of us. - if (token === SyntaxKind.InKeyword) { + if (isInOrOfKeyword(token)) { return true; } @@ -3159,6 +3159,10 @@ module ts { return parseBinaryExpressionRest(precedence, leftOperand); } + function isInOrOfKeyword(t: SyntaxKind) { + return t === SyntaxKind.InKeyword || t === SyntaxKind.OfKeyword; + } + function parseBinaryExpressionRest(precedence: number, leftOperand: Expression): Expression { while (true) { // We either have a binary operator here, or we're finished. We call @@ -3788,7 +3792,7 @@ module ts { return finishNode(node); } - function parseForOrForInStatement(): Statement { + function parseForOrForInOrForOfStatement(): Statement { var pos = getNodePos(); parseExpected(SyntaxKind.ForKeyword); parseExpected(SyntaxKind.OpenParenToken); @@ -3802,15 +3806,21 @@ module ts { initializer = disallowInAnd(parseExpression); } } - var forOrForInStatement: IterationStatement; + var forOrForInOrForOfStatement: IterationStatement; if (parseOptional(SyntaxKind.InKeyword)) { var forInStatement = createNode(SyntaxKind.ForInStatement, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); - forOrForInStatement = forInStatement; + forOrForInOrForOfStatement = forInStatement; } - else { + else if (parseOptional(SyntaxKind.OfKeyword)) { + var forOfStatement = createNode(SyntaxKind.ForOfStatement, pos); + forOfStatement.initializer = initializer; + forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); + parseExpected(SyntaxKind.CloseParenToken); + forOrForInOrForOfStatement = forOfStatement; + } else { var forStatement = createNode(SyntaxKind.ForStatement, pos); forStatement.initializer = initializer; parseExpected(SyntaxKind.SemicolonToken); @@ -3822,12 +3832,12 @@ module ts { forStatement.iterator = allowInAnd(parseExpression); } parseExpected(SyntaxKind.CloseParenToken); - forOrForInStatement = forStatement; + forOrForInOrForOfStatement = forStatement; } - forOrForInStatement.statement = parseStatement(); + forOrForInOrForOfStatement.statement = parseStatement(); - return finishNode(forOrForInStatement); + return finishNode(forOrForInOrForOfStatement); } function parseBreakOrContinueStatement(kind: SyntaxKind): BreakOrContinueStatement { @@ -4073,7 +4083,7 @@ module ts { case SyntaxKind.WhileKeyword: return parseWhileStatement(); case SyntaxKind.ForKeyword: - return parseForOrForInStatement(); + return parseForOrForInOrForOfStatement(); case SyntaxKind.ContinueKeyword: return parseBreakOrContinueStatement(SyntaxKind.ContinueStatement); case SyntaxKind.BreakKeyword: @@ -4215,7 +4225,9 @@ module ts { var node = createNode(SyntaxKind.VariableDeclaration); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); - node.initializer = parseInitializer(/*inParameter*/ false); + if (!isInOrOfKeyword(token)) { + node.initializer = parseInitializer(/*inParameter*/ false); + } return finishNode(node); } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index fbbd69bbd69..7700d2389a0 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -93,6 +93,7 @@ module ts { "while": SyntaxKind.WhileKeyword, "with": SyntaxKind.WithKeyword, "yield": SyntaxKind.YieldKeyword, + "of": SyntaxKind.OfKeyword, "{": SyntaxKind.OpenBraceToken, "}": SyntaxKind.CloseBraceToken, "(": SyntaxKind.OpenParenToken, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 12c5af21e12..04b44a5c1c0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -141,7 +141,7 @@ module ts { SetKeyword, StringKeyword, TypeKeyword, - + OfKeyword, // Parse tree nodes // Names @@ -210,6 +210,7 @@ module ts { WhileStatement, ForStatement, ForInStatement, + ForOfStatement, ContinueStatement, BreakStatement, ReturnStatement, @@ -259,7 +260,7 @@ module ts { FirstReservedWord = BreakKeyword, LastReservedWord = WithKeyword, FirstKeyword = BreakKeyword, - LastKeyword = TypeKeyword, + LastKeyword = OfKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypeReference, @@ -752,6 +753,11 @@ module ts { expression: Expression; } + export interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } + export interface BreakOrContinueStatement extends Statement { label?: Identifier; } From 7947590ee5ad1bdb4b98ff708ae7659031c87df6 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 5 Feb 2015 16:29:59 -0800 Subject: [PATCH 02/12] added ForOfStatement to forEachChild --- src/compiler/parser.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a90a4a9ab62..64f9560999b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -191,6 +191,10 @@ module ts { return visitNode(cbNode, (node).initializer) || visitNode(cbNode, (node).expression) || visitNode(cbNode, (node).statement); + case SyntaxKind.ForOfStatement: + return visitNode(cbNode, (node).initializer) || + visitNode(cbNode, (node).expression) || + visitNode(cbNode, (node).statement); case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: return visitNode(cbNode, (node).label); From 2c4244d749fb591f4c6eb15dba86045e229ec92b Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Mon, 16 Feb 2015 16:33:07 -0800 Subject: [PATCH 03/12] Accept API baseline changes --- .../baselines/reference/APISample_compile.js | 192 ++++++++-------- .../reference/APISample_compile.types | 205 +++++++++-------- tests/baselines/reference/APISample_linter.js | 210 +++++++++--------- .../reference/APISample_linter.types | 205 +++++++++-------- .../reference/APISample_transform.js | 192 ++++++++-------- .../reference/APISample_transform.types | 205 +++++++++-------- .../baselines/reference/APISample_watcher.js | 192 ++++++++-------- .../reference/APISample_watcher.types | 205 +++++++++-------- 8 files changed, 853 insertions(+), 753 deletions(-) diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index b91a706aa45..3a291f8375c 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -180,105 +180,107 @@ declare module "typescript" { SetKeyword = 118, StringKeyword = 119, TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + OfKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ForOfStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportDeclaration = 199, + ExportAssignment = 200, + ExternalModuleReference = 201, + CaseClause = 202, + DefaultClause = 203, + HeritageClause = 204, + CatchClause = 205, + PropertyAssignment = 206, + ShorthandPropertyAssignment = 207, + EnumMember = 208, + SourceFile = 209, + SyntaxList = 210, + Count = 211, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -291,7 +293,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, @@ -622,6 +624,10 @@ declare module "typescript" { initializer: VariableDeclarationList | Expression; expression: Expression; } + interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } interface BreakOrContinueStatement extends Statement { label?: Identifier; } diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index ae53c666807..70b9451af81 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -556,271 +556,277 @@ declare module "typescript" { TypeKeyword = 120, >TypeKeyword : SyntaxKind - QualifiedName = 121, + OfKeyword = 121, +>OfKeyword : SyntaxKind + + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ForOfStatement = 180, +>ForOfStatement : SyntaxKind + + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 199, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 201, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 202, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 203, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 204, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 205, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 206, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 207, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 208, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 209, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 210, >SyntaxList : SyntaxKind - Count = 209, + Count = 211, >Count : SyntaxKind FirstAssignment = 52, @@ -838,7 +844,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -847,10 +853,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -889,7 +895,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1870,6 +1876,19 @@ declare module "typescript" { expression: Expression; >expression : Expression +>Expression : Expression + } + interface ForOfStatement extends IterationStatement { +>ForOfStatement : ForOfStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression >Expression : Expression } interface BreakOrContinueStatement extends Statement { diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 68c13edb7db..f1c5c0fe99e 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -211,105 +211,107 @@ declare module "typescript" { SetKeyword = 118, StringKeyword = 119, TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + OfKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ForOfStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportDeclaration = 199, + ExportAssignment = 200, + ExternalModuleReference = 201, + CaseClause = 202, + DefaultClause = 203, + HeritageClause = 204, + CatchClause = 205, + PropertyAssignment = 206, + ShorthandPropertyAssignment = 207, + EnumMember = 208, + SourceFile = 209, + SyntaxList = 210, + Count = 211, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -322,7 +324,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, @@ -653,6 +655,10 @@ declare module "typescript" { initializer: VariableDeclarationList | Expression; expression: Expression; } + interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } interface BreakOrContinueStatement extends Statement { label?: Identifier; } @@ -1976,24 +1982,24 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 177 /* ForStatement */: - case 178 /* ForInStatement */: - case 176 /* WhileStatement */: - case 175 /* DoStatement */: - if (node.statement.kind !== 170 /* Block */) { + case 178 /* ForStatement */: + case 179 /* ForInStatement */: + case 177 /* WhileStatement */: + case 176 /* DoStatement */: + if (node.statement.kind !== 171 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 174 /* IfStatement */: + case 175 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 170 /* Block */) { + if (ifStatement.thenStatement.kind !== 171 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 170 /* Block */ && ifStatement.elseStatement.kind !== 174 /* IfStatement */) { + if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 171 /* Block */ && ifStatement.elseStatement.kind !== 175 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 163 /* BinaryExpression */: + case 164 /* BinaryExpression */: var op = node.operator; if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 0c153e7b1dc..87ff77cb26b 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -700,271 +700,277 @@ declare module "typescript" { TypeKeyword = 120, >TypeKeyword : SyntaxKind - QualifiedName = 121, + OfKeyword = 121, +>OfKeyword : SyntaxKind + + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ForOfStatement = 180, +>ForOfStatement : SyntaxKind + + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 199, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 201, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 202, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 203, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 204, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 205, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 206, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 207, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 208, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 209, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 210, >SyntaxList : SyntaxKind - Count = 209, + Count = 211, >Count : SyntaxKind FirstAssignment = 52, @@ -982,7 +988,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -991,10 +997,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1033,7 +1039,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2014,6 +2020,19 @@ declare module "typescript" { expression: Expression; >expression : Expression +>Expression : Expression + } + interface ForOfStatement extends IterationStatement { +>ForOfStatement : ForOfStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression >Expression : Expression } interface BreakOrContinueStatement extends Statement { diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index 0e80f6b55b9..0abe024854f 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -212,105 +212,107 @@ declare module "typescript" { SetKeyword = 118, StringKeyword = 119, TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + OfKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ForOfStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportDeclaration = 199, + ExportAssignment = 200, + ExternalModuleReference = 201, + CaseClause = 202, + DefaultClause = 203, + HeritageClause = 204, + CatchClause = 205, + PropertyAssignment = 206, + ShorthandPropertyAssignment = 207, + EnumMember = 208, + SourceFile = 209, + SyntaxList = 210, + Count = 211, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -323,7 +325,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, @@ -654,6 +656,10 @@ declare module "typescript" { initializer: VariableDeclarationList | Expression; expression: Expression; } + interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } interface BreakOrContinueStatement extends Statement { label?: Identifier; } diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 0c201b0a5fd..8e9d349cf1f 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -652,271 +652,277 @@ declare module "typescript" { TypeKeyword = 120, >TypeKeyword : SyntaxKind - QualifiedName = 121, + OfKeyword = 121, +>OfKeyword : SyntaxKind + + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ForOfStatement = 180, +>ForOfStatement : SyntaxKind + + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 199, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 201, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 202, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 203, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 204, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 205, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 206, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 207, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 208, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 209, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 210, >SyntaxList : SyntaxKind - Count = 209, + Count = 211, >Count : SyntaxKind FirstAssignment = 52, @@ -934,7 +940,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -943,10 +949,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -985,7 +991,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1966,6 +1972,19 @@ declare module "typescript" { expression: Expression; >expression : Expression +>Expression : Expression + } + interface ForOfStatement extends IterationStatement { +>ForOfStatement : ForOfStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression >Expression : Expression } interface BreakOrContinueStatement extends Statement { diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 27a2ce5e415..2aeede54d51 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -249,105 +249,107 @@ declare module "typescript" { SetKeyword = 118, StringKeyword = 119, TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + OfKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ForOfStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportDeclaration = 199, + ExportAssignment = 200, + ExternalModuleReference = 201, + CaseClause = 202, + DefaultClause = 203, + HeritageClause = 204, + CatchClause = 205, + PropertyAssignment = 206, + ShorthandPropertyAssignment = 207, + EnumMember = 208, + SourceFile = 209, + SyntaxList = 210, + Count = 211, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -360,7 +362,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, @@ -691,6 +693,10 @@ declare module "typescript" { initializer: VariableDeclarationList | Expression; expression: Expression; } + interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } interface BreakOrContinueStatement extends Statement { label?: Identifier; } diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 4e137cae59d..bcf11cc6df4 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -825,271 +825,277 @@ declare module "typescript" { TypeKeyword = 120, >TypeKeyword : SyntaxKind - QualifiedName = 121, + OfKeyword = 121, +>OfKeyword : SyntaxKind + + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ForOfStatement = 180, +>ForOfStatement : SyntaxKind + + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 199, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 201, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 202, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 203, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 204, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 205, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 206, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 207, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 208, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 209, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 210, >SyntaxList : SyntaxKind - Count = 209, + Count = 211, >Count : SyntaxKind FirstAssignment = 52, @@ -1107,7 +1113,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -1116,10 +1122,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1158,7 +1164,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2139,6 +2145,19 @@ declare module "typescript" { expression: Expression; >expression : Expression +>Expression : Expression + } + interface ForOfStatement extends IterationStatement { +>ForOfStatement : ForOfStatement +>IterationStatement : IterationStatement + + initializer: VariableDeclarationList | Expression; +>initializer : Expression | VariableDeclarationList +>VariableDeclarationList : VariableDeclarationList +>Expression : Expression + + expression: Expression; +>expression : Expression >Expression : Expression } interface BreakOrContinueStatement extends Statement { From 1a3294a7d246ce1fb3d073dd8388f6ce1426d1b5 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 12:37:14 -0800 Subject: [PATCH 04/12] Parity sweep for for-in & for-of --- src/compiler/binder.ts | 1 + src/compiler/checker.ts | 42 +++++++++++++------ .../diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- src/compiler/parser.ts | 3 +- src/compiler/utilities.ts | 5 ++- src/services/breakpoints.ts | 7 +++- src/services/formatting/rules.ts | 1 + src/services/formatting/smartIndenter.ts | 1 + src/services/outliningElementsCollector.ts | 1 + src/services/services.ts | 6 ++- 11 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index be9e9a525c0..037892bf972 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -495,6 +495,7 @@ module ts { case SyntaxKind.CatchClause: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.SwitchStatement: bindChildren(node, 0, /*isBlockScopeContainer*/ true); break; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index caf07cbf4dc..3e6ac9ffe2e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4612,6 +4612,7 @@ module ts { case SyntaxKind.WhileStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ReturnStatement: case SyntaxKind.WithStatement: case SyntaxKind.SwitchStatement: @@ -8449,23 +8450,12 @@ module ts { function checkForOfStatement(node: ForOfStatement) { // TODO: not yet implemented - if (!checkGrammarForStatementInAmbientContext(node)) { - checkGrammarForOfStatement(node); - } + checkGrammarForOfStatement(node); } function checkForInStatement(node: ForInStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { - if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { - var variableList = node.initializer; - if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - grammarErrorOnFirstToken(variableList.declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - } - } - } + checkGrammarForInOrForOfStatement(node); // TypeScript 1.0 spec (April 2014): 5.4 // In a 'for-in' statement of the form @@ -9568,6 +9558,7 @@ module ts { case SyntaxKind.WhileStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: case SyntaxKind.ReturnStatement: @@ -10764,10 +10755,33 @@ module ts { } } + function checkGrammarForInOrForOfStatement(forInOrOfStatement: ForInStatement | ForOfStatement): boolean { + if (checkGrammarForStatementInAmbientContext(forInOrOfStatement)) { + return true; + } + + if (forInOrOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList) { + var variableList = forInOrOfStatement.initializer; + if (!checkGrammarVariableDeclarationList(variableList)) { + if (variableList.declarations.length > 1) { + var keywordText = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? "in" : "of"; + return grammarErrorOnFirstToken(variableList.declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_0_statement, keywordText); + } + } + } + + return false; + } + function checkGrammarForOfStatement(forOfStatement: ForOfStatement): boolean { + if (checkGrammarForInOrForOfStatement(forOfStatement)) { + return true; + } if (languageVersion < ScriptTarget.ES6) { return grammarErrorOnFirstToken(forOfStatement, Diagnostics.For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); } + + return false; } function checkGrammarAccessor(accessor: MethodDeclaration): boolean { @@ -10862,6 +10876,7 @@ module ts { switch (node.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: return true; @@ -11018,6 +11033,7 @@ module ts { case SyntaxKind.WithStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: return false; case SyntaxKind.LabeledStatement: return allowLetAndConstDeclarations(parent.parent); diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index a661f53ddfc..b9b407eb1d5 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -55,7 +55,7 @@ module ts { An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_0_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...{0}' statement." }, Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, An_accessor_cannot_have_type_parameters: { code: 1094, category: DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d59d4fe0d8e..b59bd229e62 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -211,7 +211,7 @@ "category": "Error", "code": 1090 }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { + "Only a single variable declaration is allowed in a 'for...{0}' statement.": { "category": "Error", "code": 1091 }, diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 64f9560999b..d40101aacc3 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1602,7 +1602,7 @@ module ts { } // in the case where we're parsing the variable declarator of a 'for-in' statement, we - // are done if we see an 'in' keyword in front of us. + // are done if we see an 'in' keyword in front of us. Same with for-of if (isInOrOfKeyword(token)) { return true; } @@ -1881,6 +1881,7 @@ module ts { case SyntaxKind.BreakStatement: case SyntaxKind.ContinueStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ForStatement: case SyntaxKind.WhileStatement: case SyntaxKind.WithStatement: diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 5a50e2799dc..d3a7392c2bc 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -343,6 +343,7 @@ module ts { case SyntaxKind.WhileStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.WithStatement: case SyntaxKind.SwitchStatement: case SyntaxKind.CaseClause: @@ -560,7 +561,8 @@ module ts { forStatement.condition === node || forStatement.iterator === node; case SyntaxKind.ForInStatement: - var forInStatement = parent; + case SyntaxKind.ForOfStatement: + var forInStatement = parent; return (forInStatement.initializer === node && forInStatement.initializer.kind !== SyntaxKind.VariableDeclarationList) || forInStatement.expression === node; case SyntaxKind.TypeAssertionExpression: @@ -688,6 +690,7 @@ module ts { case SyntaxKind.ExpressionStatement: case SyntaxKind.EmptyStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ForStatement: case SyntaxKind.IfStatement: case SyntaxKind.LabeledStatement: diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index e49d035559b..86b72b711c1 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -151,8 +151,9 @@ module ts.BreakpointResolver { return spanInForStatement(node); case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: // span on for (a in ...) - return textSpan(node, findNextToken((node).expression, node)); + return textSpan(node, findNextToken((node).expression, node)); case SyntaxKind.SwitchStatement: // span on switch(...) @@ -261,7 +262,8 @@ module ts.BreakpointResolver { function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement) { + if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement || + variableDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement) { return spanInNode(variableDeclaration.parent.parent); } @@ -362,6 +364,7 @@ module ts.BreakpointResolver { case SyntaxKind.WhileStatement: case SyntaxKind.IfStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 9fcc787030d..bf7e3f3988a 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -592,6 +592,7 @@ module ts.formatting { case SyntaxKind.SwitchStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.WhileStatement: case SyntaxKind.TryStatement: case SyntaxKind.DoStatement: diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 3aa97fe6ae6..8d7d96e5887 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -359,6 +359,7 @@ module ts.formatting { case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ForStatement: case SyntaxKind.IfStatement: case SyntaxKind.FunctionDeclaration: diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 0b39f54ca29..b65ad7e36c8 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -61,6 +61,7 @@ module ts { // to be the entire span of the parent. if (parent.kind === SyntaxKind.DoStatement || parent.kind === SyntaxKind.ForInStatement || + parent.kind === SyntaxKind.ForOfStatement || parent.kind === SyntaxKind.ForStatement || parent.kind === SyntaxKind.IfStatement || parent.kind === SyntaxKind.WhileStatement || diff --git a/src/services/services.ts b/src/services/services.ts index 767d1a7f099..c1528fe67cf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3441,7 +3441,9 @@ module ts { } break; case SyntaxKind.ForKeyword: - if (hasKind(node.parent, SyntaxKind.ForStatement) || hasKind(node.parent, SyntaxKind.ForInStatement)) { + if (hasKind(node.parent, SyntaxKind.ForStatement) || + hasKind(node.parent, SyntaxKind.ForInStatement) || + hasKind(node.parent, SyntaxKind.ForOfStatement)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -3718,6 +3720,7 @@ module ts { switch (owner.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: return getLoopBreakContinueOccurrences(owner) @@ -3762,6 +3765,7 @@ module ts { // Fall through. case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement: if (!statement.label || isLabeledBy(node, statement.label.text)) { From 7fe286061d7275ce50582952564f5cb5d2f632f2 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 12:38:10 -0800 Subject: [PATCH 05/12] Add tests for for-of --- .../ecmascript5/Statements/parserES5ForOfStatement1.d.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement10.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement11.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement12.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement13.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement14.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement15.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement16.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement2.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement3.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement4.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement5.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement6.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement7.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement8.ts | 3 +++ .../parser/ecmascript5/Statements/parserES5ForOfStatement9.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement1.d.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement10.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement11.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement12.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement13.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement14.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement15.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement16.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement2.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement3.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement4.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement5.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement6.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement7.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement8.ts | 3 +++ .../parser/ecmascript6/Iterators/parserForOfStatement9.ts | 3 +++ 32 files changed, 96 insertions(+) create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts new file mode 100644 index 00000000000..8f9a4072f42 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var i of e) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts new file mode 100644 index 00000000000..3a6f932e821 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (const v of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts new file mode 100644 index 00000000000..94ca9330ab0 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (const [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts new file mode 100644 index 00000000000..7d4655e4b36 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (const {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts new file mode 100644 index 00000000000..7a11d2e073e --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (let {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts new file mode 100644 index 00000000000..c39939a1a08 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (let [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts new file mode 100644 index 00000000000..95c5c2c53ee --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts new file mode 100644 index 00000000000..9a68bad827c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts new file mode 100644 index 00000000000..7ef97688115 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts new file mode 100644 index 00000000000..1b183225b74 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var a, b of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts new file mode 100644 index 00000000000..a99b69a2f4a --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var a = 1 of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts new file mode 100644 index 00000000000..c3c434b605c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var a: number of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts new file mode 100644 index 00000000000..4e03b361e73 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var a = 1, b = 2 of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts new file mode 100644 index 00000000000..8340bab563b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var a: number = 1, b: string = "" of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts new file mode 100644 index 00000000000..39ecbcfbcb3 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (var v of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts new file mode 100644 index 00000000000..63fe58a93f8 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts @@ -0,0 +1,3 @@ +//@target: ES5 +for (let v of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts new file mode 100644 index 00000000000..9248d2fb45c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var i of e) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts new file mode 100644 index 00000000000..9febb87d74f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (const v of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts new file mode 100644 index 00000000000..dbcf40c36ab --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (const [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts new file mode 100644 index 00000000000..8bb57d3a356 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (const {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts new file mode 100644 index 00000000000..5da8edc65c4 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (let {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts new file mode 100644 index 00000000000..ddd1216471f --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (let [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts new file mode 100644 index 00000000000..43e18b460ca --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var [a, b] of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts new file mode 100644 index 00000000000..e042179fbba --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var {a, b} of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts new file mode 100644 index 00000000000..8274876781d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts new file mode 100644 index 00000000000..d16c99e6c3d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var a, b of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts new file mode 100644 index 00000000000..f7cd4b34d26 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var a = 1 of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts new file mode 100644 index 00000000000..789e5f9725d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var a: number of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts new file mode 100644 index 00000000000..946e5ba1574 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var a = 1, b = 2 of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts new file mode 100644 index 00000000000..e7e56f74c4e --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var a: number = 1, b: string = "" of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts new file mode 100644 index 00000000000..7a528a9898e --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (var v of X) { +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts new file mode 100644 index 00000000000..741a56a8cf7 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts @@ -0,0 +1,3 @@ +//@target: ES6 +for (let v of X) { +} \ No newline at end of file From 8d0829594c239d0d7f251f96aa4edb5dca12ed70 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 12:38:21 -0800 Subject: [PATCH 06/12] Accept baselines for added tests --- .../reference/parserES5ForOfStatement1.d.errors.txt | 8 ++++++++ .../reference/parserES5ForOfStatement10.errors.txt | 11 +++++++++++ .../baselines/reference/parserES5ForOfStatement10.js | 7 +++++++ .../reference/parserES5ForOfStatement11.errors.txt | 11 +++++++++++ .../baselines/reference/parserES5ForOfStatement11.js | 7 +++++++ .../reference/parserES5ForOfStatement12.errors.txt | 11 +++++++++++ .../baselines/reference/parserES5ForOfStatement12.js | 7 +++++++ .../reference/parserES5ForOfStatement13.errors.txt | 11 +++++++++++ .../baselines/reference/parserES5ForOfStatement13.js | 7 +++++++ .../reference/parserES5ForOfStatement14.errors.txt | 11 +++++++++++ .../baselines/reference/parserES5ForOfStatement14.js | 7 +++++++ .../reference/parserES5ForOfStatement15.errors.txt | 8 ++++++++ .../baselines/reference/parserES5ForOfStatement15.js | 7 +++++++ .../reference/parserES5ForOfStatement16.errors.txt | 8 ++++++++ .../baselines/reference/parserES5ForOfStatement16.js | 7 +++++++ .../reference/parserES5ForOfStatement3.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement3.js | 7 +++++++ .../reference/parserES5ForOfStatement4.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement4.js | 7 +++++++ .../reference/parserES5ForOfStatement5.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement5.js | 7 +++++++ .../reference/parserES5ForOfStatement6.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement6.js | 7 +++++++ .../reference/parserES5ForOfStatement7.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement7.js | 7 +++++++ .../reference/parserES5ForOfStatement8.errors.txt | 8 ++++++++ tests/baselines/reference/parserES5ForOfStatement8.js | 7 +++++++ .../reference/parserES5ForOfStatement9.errors.txt | 11 +++++++++++ tests/baselines/reference/parserES5ForOfStatement9.js | 7 +++++++ .../reference/parserForOfStatement1.d.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement10.js | 7 +++++++ .../baselines/reference/parserForOfStatement10.types | 5 +++++ tests/baselines/reference/parserForOfStatement11.js | 7 +++++++ .../baselines/reference/parserForOfStatement11.types | 6 ++++++ tests/baselines/reference/parserForOfStatement12.js | 7 +++++++ .../baselines/reference/parserForOfStatement12.types | 6 ++++++ tests/baselines/reference/parserForOfStatement13.js | 7 +++++++ .../baselines/reference/parserForOfStatement13.types | 6 ++++++ tests/baselines/reference/parserForOfStatement14.js | 7 +++++++ .../baselines/reference/parserForOfStatement14.types | 6 ++++++ tests/baselines/reference/parserForOfStatement15.js | 7 +++++++ .../baselines/reference/parserForOfStatement15.types | 6 ++++++ tests/baselines/reference/parserForOfStatement16.js | 7 +++++++ .../baselines/reference/parserForOfStatement16.types | 6 ++++++ .../reference/parserForOfStatement3.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement3.js | 7 +++++++ tests/baselines/reference/parserForOfStatement4.js | 7 +++++++ tests/baselines/reference/parserForOfStatement5.js | 7 +++++++ .../reference/parserForOfStatement6.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement6.js | 7 +++++++ .../reference/parserForOfStatement7.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement7.js | 7 +++++++ tests/baselines/reference/parserForOfStatement8.js | 7 +++++++ tests/baselines/reference/parserForOfStatement8.types | 5 +++++ tests/baselines/reference/parserForOfStatement9.js | 7 +++++++ tests/baselines/reference/parserForOfStatement9.types | 5 +++++ 56 files changed, 417 insertions(+) create mode 100644 tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement10.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement10.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement11.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement11.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement12.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement12.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement13.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement13.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement14.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement14.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement15.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement15.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement16.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement16.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement3.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement3.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement4.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement4.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement5.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement5.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement6.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement6.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement7.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement7.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement8.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement8.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement9.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement9.js create mode 100644 tests/baselines/reference/parserForOfStatement1.d.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement10.js create mode 100644 tests/baselines/reference/parserForOfStatement10.types create mode 100644 tests/baselines/reference/parserForOfStatement11.js create mode 100644 tests/baselines/reference/parserForOfStatement11.types create mode 100644 tests/baselines/reference/parserForOfStatement12.js create mode 100644 tests/baselines/reference/parserForOfStatement12.types create mode 100644 tests/baselines/reference/parserForOfStatement13.js create mode 100644 tests/baselines/reference/parserForOfStatement13.types create mode 100644 tests/baselines/reference/parserForOfStatement14.js create mode 100644 tests/baselines/reference/parserForOfStatement14.types create mode 100644 tests/baselines/reference/parserForOfStatement15.js create mode 100644 tests/baselines/reference/parserForOfStatement15.types create mode 100644 tests/baselines/reference/parserForOfStatement16.js create mode 100644 tests/baselines/reference/parserForOfStatement16.types create mode 100644 tests/baselines/reference/parserForOfStatement3.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement3.js create mode 100644 tests/baselines/reference/parserForOfStatement4.js create mode 100644 tests/baselines/reference/parserForOfStatement5.js create mode 100644 tests/baselines/reference/parserForOfStatement6.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement6.js create mode 100644 tests/baselines/reference/parserForOfStatement7.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement7.js create mode 100644 tests/baselines/reference/parserForOfStatement8.js create mode 100644 tests/baselines/reference/parserForOfStatement8.types create mode 100644 tests/baselines/reference/parserForOfStatement9.js create mode 100644 tests/baselines/reference/parserForOfStatement9.types diff --git a/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt new file mode 100644 index 00000000000..f3034cd2c27 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts (1 errors) ==== + for (var i of e) { + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement10.errors.txt b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt new file mode 100644 index 00000000000..7fdbe80e12e --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts (2 errors) ==== + for (const v of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement10.js b/tests/baselines/reference/parserES5ForOfStatement10.js new file mode 100644 index 00000000000..2b9dc843887 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement10.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement10.ts] +for (const v of X) { +} + +//// [parserES5ForOfStatement10.js] +for (var v of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement11.errors.txt b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt new file mode 100644 index 00000000000..146aff8f91b --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts (2 errors) ==== + for (const [a, b] of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement11.js b/tests/baselines/reference/parserES5ForOfStatement11.js new file mode 100644 index 00000000000..45a24b109c0 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement11.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement11.ts] +for (const [a, b] of X) { +} + +//// [parserES5ForOfStatement11.js] +for (var _a = void 0, a = _a[0], b = _a[1] of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement12.errors.txt b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt new file mode 100644 index 00000000000..ea1ad1d8eb7 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts (2 errors) ==== + for (const {a, b} of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement12.js b/tests/baselines/reference/parserES5ForOfStatement12.js new file mode 100644 index 00000000000..30beac5118c --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement12.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement12.ts] +for (const {a, b} of X) { +} + +//// [parserES5ForOfStatement12.js] +for (var _a = void 0, a = _a.a, b = _a.b of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement13.errors.txt b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt new file mode 100644 index 00000000000..27dc44f094a --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts (2 errors) ==== + for (let {a, b} of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement13.js b/tests/baselines/reference/parserES5ForOfStatement13.js new file mode 100644 index 00000000000..89706613add --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement13.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement13.ts] +for (let {a, b} of X) { +} + +//// [parserES5ForOfStatement13.js] +for (let _a = void 0, a = _a.a, b = _a.b of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement14.errors.txt b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt new file mode 100644 index 00000000000..9eba6e25c9a --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts (2 errors) ==== + for (let [a, b] of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement14.js b/tests/baselines/reference/parserES5ForOfStatement14.js new file mode 100644 index 00000000000..96aa327a625 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement14.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement14.ts] +for (let [a, b] of X) { +} + +//// [parserES5ForOfStatement14.js] +for (let _a = void 0, a = _a[0], b = _a[1] of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement15.errors.txt b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt new file mode 100644 index 00000000000..2f39244ecd5 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts (1 errors) ==== + for (var [a, b] of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement15.js b/tests/baselines/reference/parserES5ForOfStatement15.js new file mode 100644 index 00000000000..efca0b289f6 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement15.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement15.ts] +for (var [a, b] of X) { +} + +//// [parserES5ForOfStatement15.js] +for (var _a = void 0, a = _a[0], b = _a[1] of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement16.errors.txt b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt new file mode 100644 index 00000000000..80a45c0f8b5 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts (1 errors) ==== + for (var {a, b} of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement16.js b/tests/baselines/reference/parserES5ForOfStatement16.js new file mode 100644 index 00000000000..102e91685c3 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement16.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement16.ts] +for (var {a, b} of X) { +} + +//// [parserES5ForOfStatement16.js] +for (var _a = void 0, a = _a.a, b = _a.b of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt new file mode 100644 index 00000000000..6209ed2475f --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,13): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts (1 errors) ==== + for (var a, b of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement3.js b/tests/baselines/reference/parserES5ForOfStatement3.js new file mode 100644 index 00000000000..64892eb5094 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement3.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement3.ts] +for (var a, b of X) { +} + +//// [parserES5ForOfStatement3.js] +for (var a of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt new file mode 100644 index 00000000000..36c1894ed78 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts (1 errors) ==== + for (var a = 1 of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement4.js b/tests/baselines/reference/parserES5ForOfStatement4.js new file mode 100644 index 00000000000..e17699a8662 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement4.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement4.ts] +for (var a = 1 of X) { +} + +//// [parserES5ForOfStatement4.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt new file mode 100644 index 00000000000..55c56d60aae --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts (1 errors) ==== + for (var a: number of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement5.js b/tests/baselines/reference/parserES5ForOfStatement5.js new file mode 100644 index 00000000000..2eeb504365e --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement5.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement5.ts] +for (var a: number of X) { +} + +//// [parserES5ForOfStatement5.js] +for (var a of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt new file mode 100644 index 00000000000..1bbacc01c9e --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,17): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts (1 errors) ==== + for (var a = 1, b = 2 of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement6.js b/tests/baselines/reference/parserES5ForOfStatement6.js new file mode 100644 index 00000000000..575368fcd20 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement6.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement6.ts] +for (var a = 1, b = 2 of X) { +} + +//// [parserES5ForOfStatement6.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt new file mode 100644 index 00000000000..7d2810f6de7 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts (1 errors) ==== + for (var a: number = 1, b: string = "" of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement7.js b/tests/baselines/reference/parserES5ForOfStatement7.js new file mode 100644 index 00000000000..ac240494c18 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement7.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement7.ts] +for (var a: number = 1, b: string = "" of X) { +} + +//// [parserES5ForOfStatement7.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement8.errors.txt b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt new file mode 100644 index 00000000000..739369e8f82 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts (1 errors) ==== + for (var v of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement8.js b/tests/baselines/reference/parserES5ForOfStatement8.js new file mode 100644 index 00000000000..c926784adfe --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement8.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement8.ts] +for (var v of X) { +} + +//// [parserES5ForOfStatement8.js] +for (var v of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement9.errors.txt b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt new file mode 100644 index 00000000000..c03669fcb98 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts (2 errors) ==== + for (let v of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement9.js b/tests/baselines/reference/parserES5ForOfStatement9.js new file mode 100644 index 00000000000..e2ec49e9ac9 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement9.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement9.ts] +for (let v of X) { +} + +//// [parserES5ForOfStatement9.js] +for (let v of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement1.d.errors.txt b/tests/baselines/reference/parserForOfStatement1.d.errors.txt new file mode 100644 index 00000000000..3b1b2a65922 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement1.d.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts (1 errors) ==== + for (var i of e) { + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement10.js b/tests/baselines/reference/parserForOfStatement10.js new file mode 100644 index 00000000000..d0b48203090 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement10.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement10.ts] +for (const v of X) { +} + +//// [parserForOfStatement10.js] +for (var v of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement10.types b/tests/baselines/reference/parserForOfStatement10.types new file mode 100644 index 00000000000..1707fa934cb --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement10.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts === +for (const v of X) { +>v : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement11.js b/tests/baselines/reference/parserForOfStatement11.js new file mode 100644 index 00000000000..daa3fb6df48 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement11.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement11.ts] +for (const [a, b] of X) { +} + +//// [parserForOfStatement11.js] +for (var [a, b] of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement11.types b/tests/baselines/reference/parserForOfStatement11.types new file mode 100644 index 00000000000..eebc0c6a864 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement11.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts === +for (const [a, b] of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement12.js b/tests/baselines/reference/parserForOfStatement12.js new file mode 100644 index 00000000000..2e62b90de5e --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement12.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement12.ts] +for (const {a, b} of X) { +} + +//// [parserForOfStatement12.js] +for (var { a, b } of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement12.types b/tests/baselines/reference/parserForOfStatement12.types new file mode 100644 index 00000000000..51071059db1 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement12.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts === +for (const {a, b} of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement13.js b/tests/baselines/reference/parserForOfStatement13.js new file mode 100644 index 00000000000..a9c59046b8e --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement13.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement13.ts] +for (let {a, b} of X) { +} + +//// [parserForOfStatement13.js] +for (let { a, b } of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement13.types b/tests/baselines/reference/parserForOfStatement13.types new file mode 100644 index 00000000000..22c7af5605c --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement13.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts === +for (let {a, b} of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement14.js b/tests/baselines/reference/parserForOfStatement14.js new file mode 100644 index 00000000000..e46e2c46ea6 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement14.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement14.ts] +for (let [a, b] of X) { +} + +//// [parserForOfStatement14.js] +for (let [a, b] of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement14.types b/tests/baselines/reference/parserForOfStatement14.types new file mode 100644 index 00000000000..f255015bb15 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement14.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts === +for (let [a, b] of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement15.js b/tests/baselines/reference/parserForOfStatement15.js new file mode 100644 index 00000000000..81782393383 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement15.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement15.ts] +for (var [a, b] of X) { +} + +//// [parserForOfStatement15.js] +for (var [a, b] of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement15.types b/tests/baselines/reference/parserForOfStatement15.types new file mode 100644 index 00000000000..bf6faf3478e --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement15.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts === +for (var [a, b] of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement16.js b/tests/baselines/reference/parserForOfStatement16.js new file mode 100644 index 00000000000..f0ca1ee3e6d --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement16.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement16.ts] +for (var {a, b} of X) { +} + +//// [parserForOfStatement16.js] +for (var { a, b } of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement16.types b/tests/baselines/reference/parserForOfStatement16.types new file mode 100644 index 00000000000..48476dfae0a --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement16.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts === +for (var {a, b} of X) { +>a : any +>b : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement3.errors.txt b/tests/baselines/reference/parserForOfStatement3.errors.txt new file mode 100644 index 00000000000..36cd23b0931 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement3.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,13): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts (1 errors) ==== + for (var a, b of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement3.js b/tests/baselines/reference/parserForOfStatement3.js new file mode 100644 index 00000000000..206e8fe5af8 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement3.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement3.ts] +for (var a, b of X) { +} + +//// [parserForOfStatement3.js] +for (var a of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement4.js b/tests/baselines/reference/parserForOfStatement4.js new file mode 100644 index 00000000000..9e7549c20fc --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement4.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement4.ts] +for (var a = 1 of X) { +} + +//// [parserForOfStatement4.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement5.js b/tests/baselines/reference/parserForOfStatement5.js new file mode 100644 index 00000000000..9028ebe7e3f --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement5.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement5.ts] +for (var a: number of X) { +} + +//// [parserForOfStatement5.js] +for (var a of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement6.errors.txt b/tests/baselines/reference/parserForOfStatement6.errors.txt new file mode 100644 index 00000000000..f6a87d8a37d --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,17): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts (1 errors) ==== + for (var a = 1, b = 2 of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement6.js b/tests/baselines/reference/parserForOfStatement6.js new file mode 100644 index 00000000000..37f3560a29c --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement6.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement6.ts] +for (var a = 1, b = 2 of X) { +} + +//// [parserForOfStatement6.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement7.errors.txt b/tests/baselines/reference/parserForOfStatement7.errors.txt new file mode 100644 index 00000000000..e40bcd448f6 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement7.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts (1 errors) ==== + for (var a: number = 1, b: string = "" of X) { + ~ +!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement7.js b/tests/baselines/reference/parserForOfStatement7.js new file mode 100644 index 00000000000..0b18d0358b4 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement7.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement7.ts] +for (var a: number = 1, b: string = "" of X) { +} + +//// [parserForOfStatement7.js] +for (var a = 1 of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement8.js b/tests/baselines/reference/parserForOfStatement8.js new file mode 100644 index 00000000000..3565998701e --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement8.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement8.ts] +for (var v of X) { +} + +//// [parserForOfStatement8.js] +for (var v of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement8.types b/tests/baselines/reference/parserForOfStatement8.types new file mode 100644 index 00000000000..a4168caf262 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement8.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts === +for (var v of X) { +>v : any +>X : unknown +} diff --git a/tests/baselines/reference/parserForOfStatement9.js b/tests/baselines/reference/parserForOfStatement9.js new file mode 100644 index 00000000000..f03dad33c5f --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement9.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement9.ts] +for (let v of X) { +} + +//// [parserForOfStatement9.js] +for (let v of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement9.types b/tests/baselines/reference/parserForOfStatement9.types new file mode 100644 index 00000000000..0285a3e4b76 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement9.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts === +for (let v of X) { +>v : any +>X : unknown +} From cc81a670ac4ca600b0f6aed0ec2defb617cd95b1 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 12:47:57 -0800 Subject: [PATCH 07/12] Fork grammar message into two messages --- src/compiler/checker.ts | 6 ++++-- src/compiler/diagnosticInformationMap.generated.ts | 3 ++- src/compiler/diagnosticMessages.json | 6 +++++- .../baselines/reference/parserES5ForOfStatement3.errors.txt | 4 ++-- .../baselines/reference/parserES5ForOfStatement6.errors.txt | 4 ++-- .../baselines/reference/parserES5ForOfStatement7.errors.txt | 4 ++-- tests/baselines/reference/parserForOfStatement3.errors.txt | 4 ++-- tests/baselines/reference/parserForOfStatement6.errors.txt | 4 ++-- tests/baselines/reference/parserForOfStatement7.errors.txt | 4 ++-- 9 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3e6ac9ffe2e..125f5623412 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10764,8 +10764,10 @@ module ts { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var keywordText = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? "in" : "of"; - return grammarErrorOnFirstToken(variableList.declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_0_statement, keywordText); + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } } } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index b9b407eb1d5..ab9097ae76e 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -55,7 +55,7 @@ module ts { An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_0_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...{0}' statement." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, An_accessor_cannot_have_type_parameters: { code: 1094, category: DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, @@ -147,6 +147,7 @@ module ts { Merge_conflict_marker_encountered: { code: 1185, category: DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, A_rest_element_cannot_have_an_initializer: { code: 1186, category: DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b59bd229e62..6a5fb54f228 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -211,7 +211,7 @@ "category": "Error", "code": 1090 }, - "Only a single variable declaration is allowed in a 'for...{0}' statement.": { + "Only a single variable declaration is allowed in a 'for...in' statement.": { "category": "Error", "code": 1091 }, @@ -579,6 +579,10 @@ "category": "Error", "code": 1187 }, + "Only a single variable declaration is allowed in a 'for...of' statement.": { + "category": "Error", + "code": 1188 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt index 6209ed2475f..a976d9c0d54 100644 --- a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,13): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,13): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts (1 errors) ==== for (var a, b of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt index 1bbacc01c9e..da76589190d 100644 --- a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,17): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,17): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt index 7d2810f6de7..ced399ca103 100644 --- a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,25): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement3.errors.txt b/tests/baselines/reference/parserForOfStatement3.errors.txt index 36cd23b0931..995ef4637c2 100644 --- a/tests/baselines/reference/parserForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,13): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,13): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts (1 errors) ==== for (var a, b of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement6.errors.txt b/tests/baselines/reference/parserForOfStatement6.errors.txt index f6a87d8a37d..57d95361b65 100644 --- a/tests/baselines/reference/parserForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,17): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,17): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement7.errors.txt b/tests/baselines/reference/parserForOfStatement7.errors.txt index e40bcd448f6..07f93c263ec 100644 --- a/tests/baselines/reference/parserForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,25): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { ~ -!!! error TS1091: Only a single variable declaration is allowed in a 'for...of' statement. +!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. } \ No newline at end of file From f7a6354470d59e3d1a8c17733c0e500b3c83ed9d Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 16:59:58 -0800 Subject: [PATCH 08/12] More resilient error recovery when declaration in for-of is empty --- src/compiler/parser.ts | 33 +++++++++++++++---- .../reference/parserES5ForOfStatement17.js | 5 +++ .../reference/parserES5ForOfStatement17.types | 4 +++ .../parserES5ForOfStatement18.errors.txt | 7 ++++ .../reference/parserES5ForOfStatement18.js | 5 +++ .../reference/parserES5ForOfStatement19.js | 5 +++ .../reference/parserES5ForOfStatement19.types | 5 +++ .../parserES5ForOfStatement2.errors.txt | 11 +++++++ .../reference/parserES5ForOfStatement2.js | 7 ++++ .../reference/parserES5ForOfStatement20.js | 5 +++ .../reference/parserES5ForOfStatement20.types | 5 +++ .../parserES5ForOfStatement21.errors.txt | 10 ++++++ .../reference/parserES5ForOfStatement21.js | 5 +++ .../reference/parserForOfStatement17.js | 5 +++ .../reference/parserForOfStatement17.types | 4 +++ .../reference/parserForOfStatement18.js | 5 +++ .../reference/parserForOfStatement18.types | 5 +++ .../reference/parserForOfStatement19.js | 5 +++ .../reference/parserForOfStatement19.types | 5 +++ .../parserForOfStatement2.errors.txt | 8 +++++ .../reference/parserForOfStatement2.js | 7 ++++ .../reference/parserForOfStatement20.js | 5 +++ .../reference/parserForOfStatement20.types | 5 +++ .../parserForOfStatement21.errors.txt | 7 ++++ .../reference/parserForOfStatement21.js | 5 +++ .../Statements/parserES5ForOfStatement17.ts | 2 ++ .../Statements/parserES5ForOfStatement18.ts | 2 ++ .../Statements/parserES5ForOfStatement19.ts | 2 ++ .../Statements/parserES5ForOfStatement20.ts | 2 ++ .../Statements/parserES5ForOfStatement21.ts | 2 ++ .../Iterators/parserForOfStatement17.ts | 2 ++ .../Iterators/parserForOfStatement18.ts | 2 ++ .../Iterators/parserForOfStatement19.ts | 2 ++ .../Iterators/parserForOfStatement20.ts | 2 ++ .../Iterators/parserForOfStatement21.ts | 2 ++ 35 files changed, 186 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/parserES5ForOfStatement17.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement17.types create mode 100644 tests/baselines/reference/parserES5ForOfStatement18.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement18.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement19.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement19.types create mode 100644 tests/baselines/reference/parserES5ForOfStatement2.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement2.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement20.js create mode 100644 tests/baselines/reference/parserES5ForOfStatement20.types create mode 100644 tests/baselines/reference/parserES5ForOfStatement21.errors.txt create mode 100644 tests/baselines/reference/parserES5ForOfStatement21.js create mode 100644 tests/baselines/reference/parserForOfStatement17.js create mode 100644 tests/baselines/reference/parserForOfStatement17.types create mode 100644 tests/baselines/reference/parserForOfStatement18.js create mode 100644 tests/baselines/reference/parserForOfStatement18.types create mode 100644 tests/baselines/reference/parserForOfStatement19.js create mode 100644 tests/baselines/reference/parserForOfStatement19.types create mode 100644 tests/baselines/reference/parserForOfStatement2.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement2.js create mode 100644 tests/baselines/reference/parserForOfStatement20.js create mode 100644 tests/baselines/reference/parserForOfStatement20.types create mode 100644 tests/baselines/reference/parserForOfStatement21.errors.txt create mode 100644 tests/baselines/reference/parserForOfStatement21.js create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts create mode 100644 tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index d40101aacc3..159aa545ec9 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3805,7 +3805,7 @@ module ts { var initializer: VariableDeclarationList | Expression = undefined; if (token !== SyntaxKind.SemicolonToken) { if (token === SyntaxKind.VarKeyword || token === SyntaxKind.LetKeyword || token === SyntaxKind.ConstKeyword) { - initializer = parseVariableDeclarationList(/*disallowIn:*/ true); + initializer = parseVariableDeclarationList(/*inForStatementInitializer:*/ true); } else { initializer = disallowInAnd(parseExpression); @@ -4236,7 +4236,7 @@ module ts { return finishNode(node); } - function parseVariableDeclarationList(disallowIn: boolean): VariableDeclarationList { + function parseVariableDeclarationList(inForStatementInitializer: boolean): VariableDeclarationList { var node = createNode(SyntaxKind.VariableDeclarationList); switch (token) { @@ -4253,20 +4253,39 @@ module ts { } nextToken(); - var savedDisallowIn = inDisallowInContext(); - setDisallowInContext(disallowIn); - node.declarations = parseDelimitedList(ParsingContext.VariableDeclarations, parseVariableDeclaration); + // The user may have written the following: + // + // for (var of X) { } + // + // In this case, we want to parse an empty declaration list, and then parse 'of' + // as a keyword. The reason this is not automatic is that 'of' is a valid identifier. + // So we need to look ahead to determine if 'of' should be treated as a keyword in + // this context. + // The checker will then give an error that there is an empty declaration list. + if (token === SyntaxKind.OfKeyword && lookAhead(canFollowContextualOfKeyword)) { + node.declarations = createMissingList(); + } + else { + var savedDisallowIn = inDisallowInContext(); + setDisallowInContext(inForStatementInitializer); - setDisallowInContext(savedDisallowIn); + node.declarations = parseDelimitedList(ParsingContext.VariableDeclarations, parseVariableDeclaration); + + setDisallowInContext(savedDisallowIn); + } return finishNode(node); } + + function canFollowContextualOfKeyword(): boolean { + return nextTokenIsIdentifier() && nextToken() === SyntaxKind.CloseParenToken; + } function parseVariableStatement(fullStart: number, modifiers: ModifiersArray): VariableStatement { var node = createNode(SyntaxKind.VariableStatement, fullStart); setModifiers(node, modifiers); - node.declarationList = parseVariableDeclarationList(/*disallowIn:*/ false); + node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer:*/ false); parseSemicolon(); return finishNode(node); } diff --git a/tests/baselines/reference/parserES5ForOfStatement17.js b/tests/baselines/reference/parserES5ForOfStatement17.js new file mode 100644 index 00000000000..7995c4c689e --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement17.js @@ -0,0 +1,5 @@ +//// [parserES5ForOfStatement17.ts] +for (var of; ;) { } + +//// [parserES5ForOfStatement17.js] +for (var of;;) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement17.types b/tests/baselines/reference/parserES5ForOfStatement17.types new file mode 100644 index 00000000000..5dd0f6e9b93 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement17.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts === +for (var of; ;) { } +>of : any + diff --git a/tests/baselines/reference/parserES5ForOfStatement18.errors.txt b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt new file mode 100644 index 00000000000..e07b516abf0 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts (1 errors) ==== + for (var of of of) { } + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement18.js b/tests/baselines/reference/parserES5ForOfStatement18.js new file mode 100644 index 00000000000..1df3e0bed7b --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement18.js @@ -0,0 +1,5 @@ +//// [parserES5ForOfStatement18.ts] +for (var of of of) { } + +//// [parserES5ForOfStatement18.js] +for (var of of of) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement19.js b/tests/baselines/reference/parserES5ForOfStatement19.js new file mode 100644 index 00000000000..7ed0d5a333a --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement19.js @@ -0,0 +1,5 @@ +//// [parserES5ForOfStatement19.ts] +for (var of in of) { } + +//// [parserES5ForOfStatement19.js] +for (var of in of) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement19.types b/tests/baselines/reference/parserES5ForOfStatement19.types new file mode 100644 index 00000000000..13abc7ae757 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement19.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts === +for (var of in of) { } +>of : any +>of : any + diff --git a/tests/baselines/reference/parserES5ForOfStatement2.errors.txt b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt new file mode 100644 index 00000000000..70bf84999f5 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,9): error TS1123: Variable declaration list cannot be empty. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts (2 errors) ==== + for (var of X) { + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + +!!! error TS1123: Variable declaration list cannot be empty. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement2.js b/tests/baselines/reference/parserES5ForOfStatement2.js new file mode 100644 index 00000000000..dfcfb476172 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement2.js @@ -0,0 +1,7 @@ +//// [parserES5ForOfStatement2.ts] +for (var of X) { +} + +//// [parserES5ForOfStatement2.js] +for ( of X) { +} diff --git a/tests/baselines/reference/parserES5ForOfStatement20.js b/tests/baselines/reference/parserES5ForOfStatement20.js new file mode 100644 index 00000000000..c51cbbc2a3a --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement20.js @@ -0,0 +1,5 @@ +//// [parserES5ForOfStatement20.ts] +for (var of = 0 in of) { } + +//// [parserES5ForOfStatement20.js] +for (var of = 0 in of) { } diff --git a/tests/baselines/reference/parserES5ForOfStatement20.types b/tests/baselines/reference/parserES5ForOfStatement20.types new file mode 100644 index 00000000000..54df94516c3 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement20.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts === +for (var of = 0 in of) { } +>of : any +>of : any + diff --git a/tests/baselines/reference/parserES5ForOfStatement21.errors.txt b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt new file mode 100644 index 00000000000..338d1e34b2f --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,9): error TS1123: Variable declaration list cannot be empty. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts (2 errors) ==== + for (var of of) { } + ~~~ +!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + +!!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement21.js b/tests/baselines/reference/parserES5ForOfStatement21.js new file mode 100644 index 00000000000..e02ed853cb5 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement21.js @@ -0,0 +1,5 @@ +//// [parserES5ForOfStatement21.ts] +for (var of of) { } + +//// [parserES5ForOfStatement21.js] +for ( of of) { } diff --git a/tests/baselines/reference/parserForOfStatement17.js b/tests/baselines/reference/parserForOfStatement17.js new file mode 100644 index 00000000000..a6e2aee79a4 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement17.js @@ -0,0 +1,5 @@ +//// [parserForOfStatement17.ts] +for (var of; ;) { } + +//// [parserForOfStatement17.js] +for (var of;;) { } diff --git a/tests/baselines/reference/parserForOfStatement17.types b/tests/baselines/reference/parserForOfStatement17.types new file mode 100644 index 00000000000..64e15462dd6 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement17.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts === +for (var of; ;) { } +>of : any + diff --git a/tests/baselines/reference/parserForOfStatement18.js b/tests/baselines/reference/parserForOfStatement18.js new file mode 100644 index 00000000000..c30fbb60857 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement18.js @@ -0,0 +1,5 @@ +//// [parserForOfStatement18.ts] +for (var of of of) { } + +//// [parserForOfStatement18.js] +for (var of of of) { } diff --git a/tests/baselines/reference/parserForOfStatement18.types b/tests/baselines/reference/parserForOfStatement18.types new file mode 100644 index 00000000000..8e3b52ac877 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement18.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts === +for (var of of of) { } +>of : any +>of : any + diff --git a/tests/baselines/reference/parserForOfStatement19.js b/tests/baselines/reference/parserForOfStatement19.js new file mode 100644 index 00000000000..c838e8c71e0 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement19.js @@ -0,0 +1,5 @@ +//// [parserForOfStatement19.ts] +for (var of in of) { } + +//// [parserForOfStatement19.js] +for (var of in of) { } diff --git a/tests/baselines/reference/parserForOfStatement19.types b/tests/baselines/reference/parserForOfStatement19.types new file mode 100644 index 00000000000..6fcc5e8f792 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement19.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts === +for (var of in of) { } +>of : any +>of : any + diff --git a/tests/baselines/reference/parserForOfStatement2.errors.txt b/tests/baselines/reference/parserForOfStatement2.errors.txt new file mode 100644 index 00000000000..7229fe4196d --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement2.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts(1,9): error TS1123: Variable declaration list cannot be empty. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts (1 errors) ==== + for (var of X) { + +!!! error TS1123: Variable declaration list cannot be empty. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement2.js b/tests/baselines/reference/parserForOfStatement2.js new file mode 100644 index 00000000000..84d23d4e2aa --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement2.js @@ -0,0 +1,7 @@ +//// [parserForOfStatement2.ts] +for (var of X) { +} + +//// [parserForOfStatement2.js] +for ( of X) { +} diff --git a/tests/baselines/reference/parserForOfStatement20.js b/tests/baselines/reference/parserForOfStatement20.js new file mode 100644 index 00000000000..8599238d853 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement20.js @@ -0,0 +1,5 @@ +//// [parserForOfStatement20.ts] +for (var of = 0 in of) { } + +//// [parserForOfStatement20.js] +for (var of = 0 in of) { } diff --git a/tests/baselines/reference/parserForOfStatement20.types b/tests/baselines/reference/parserForOfStatement20.types new file mode 100644 index 00000000000..de664ca3c0f --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement20.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts === +for (var of = 0 in of) { } +>of : any +>of : any + diff --git a/tests/baselines/reference/parserForOfStatement21.errors.txt b/tests/baselines/reference/parserForOfStatement21.errors.txt new file mode 100644 index 00000000000..9103e2fedee --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement21.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts(1,9): error TS1123: Variable declaration list cannot be empty. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts (1 errors) ==== + for (var of of) { } + +!!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement21.js b/tests/baselines/reference/parserForOfStatement21.js new file mode 100644 index 00000000000..5db883e18a0 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement21.js @@ -0,0 +1,5 @@ +//// [parserForOfStatement21.ts] +for (var of of) { } + +//// [parserForOfStatement21.js] +for ( of of) { } diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts new file mode 100644 index 00000000000..882ae938d6c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts @@ -0,0 +1,2 @@ +//@target: ES5 +for (var of; ;) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts new file mode 100644 index 00000000000..a7dff6f225b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts @@ -0,0 +1,2 @@ +//@target: ES5 +for (var of of of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts new file mode 100644 index 00000000000..730f574be33 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts @@ -0,0 +1,2 @@ +//@target: ES5 +for (var of in of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts new file mode 100644 index 00000000000..edffb88a1e3 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts @@ -0,0 +1,2 @@ +//@target: ES5 +for (var of = 0 in of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts new file mode 100644 index 00000000000..a61edfbd050 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts @@ -0,0 +1,2 @@ +//@target: ES5 +for (var of of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts new file mode 100644 index 00000000000..f088b36f4fd --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts @@ -0,0 +1,2 @@ +//@target: ES6 +for (var of; ;) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts new file mode 100644 index 00000000000..268dc163dde --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts @@ -0,0 +1,2 @@ +//@target: ES6 +for (var of of of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts new file mode 100644 index 00000000000..4dff469112b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts @@ -0,0 +1,2 @@ +//@target: ES6 +for (var of in of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts new file mode 100644 index 00000000000..d0b7b75175d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts @@ -0,0 +1,2 @@ +//@target: ES6 +for (var of = 0 in of) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts new file mode 100644 index 00000000000..f480ac371a2 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts @@ -0,0 +1,2 @@ +//@target: ES6 +for (var of of) { } \ No newline at end of file From 147cc204b8d2ca2fbd032f8feaf085af481eeae0 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 17:52:55 -0800 Subject: [PATCH 09/12] Disallow initializers in for-in and for-of loops --- src/compiler/checker.ts | 6 ++++++ src/compiler/diagnosticInformationMap.generated.ts | 2 ++ src/compiler/diagnosticMessages.json | 8 ++++++++ .../reference/parserES5ForOfStatement20.errors.txt | 7 +++++++ tests/baselines/reference/parserES5ForOfStatement20.types | 5 ----- .../reference/parserES5ForOfStatement4.errors.txt | 6 +++--- .../baselines/reference/parserForInStatement4.errors.txt | 5 ++++- .../baselines/reference/parserForOfStatement20.errors.txt | 7 +++++++ tests/baselines/reference/parserForOfStatement20.types | 5 ----- .../baselines/reference/parserForOfStatement4.errors.txt | 8 ++++++++ 10 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 tests/baselines/reference/parserES5ForOfStatement20.errors.txt delete mode 100644 tests/baselines/reference/parserES5ForOfStatement20.types create mode 100644 tests/baselines/reference/parserForOfStatement20.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement20.types create mode 100644 tests/baselines/reference/parserForOfStatement4.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 125f5623412..96439b2cf68 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10769,6 +10769,12 @@ module ts { Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } + if (variableList.declarations[0].initializer) { + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? + Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : + Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + return grammarErrorOnNode(variableList.declarations[0].name, diagnostic); + } } } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index ab9097ae76e..17c0bec44a3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -148,6 +148,8 @@ module ts { A_rest_element_cannot_have_an_initializer: { code: 1186, category: DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6a5fb54f228..b0bf5945e8c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -583,6 +583,14 @@ "category": "Error", "code": 1188 }, + "The variable declaration of a 'for...in' statement cannot have an initializer.": { + "category": "Error", + "code": 1189 + }, + "The variable declaration of a 'for...of' statement cannot have an initializer.": { + "category": "Error", + "code": 1190 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/tests/baselines/reference/parserES5ForOfStatement20.errors.txt b/tests/baselines/reference/parserES5ForOfStatement20.errors.txt new file mode 100644 index 00000000000..4aee32394b6 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement20.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts(1,10): error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts (1 errors) ==== + for (var of = 0 in of) { } + ~~ +!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement20.types b/tests/baselines/reference/parserES5ForOfStatement20.types deleted file mode 100644 index 54df94516c3..00000000000 --- a/tests/baselines/reference/parserES5ForOfStatement20.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement20.ts === -for (var of = 0 in of) { } ->of : any ->of : any - diff --git a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt index 36c1894ed78..e2b38b56be5 100644 --- a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,10): error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts (1 errors) ==== for (var a = 1 of X) { - ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~ +!!! error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement4.errors.txt b/tests/baselines/reference/parserForInStatement4.errors.txt index a4df2beaedb..91484260903 100644 --- a/tests/baselines/reference/parserForInStatement4.errors.txt +++ b/tests/baselines/reference/parserForInStatement4.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement4.ts(1,10): error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement4.ts(1,19): error TS2304: Cannot find name 'X'. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement4.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement4.ts (2 errors) ==== for (var a = 1 in X) { + ~ +!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. ~ !!! error TS2304: Cannot find name 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement20.errors.txt b/tests/baselines/reference/parserForOfStatement20.errors.txt new file mode 100644 index 00000000000..461f307f6b9 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement20.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts(1,10): error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts (1 errors) ==== + for (var of = 0 in of) { } + ~~ +!!! error TS1189: The variable declaration of a 'for...in' statement cannot have an initializer. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement20.types b/tests/baselines/reference/parserForOfStatement20.types deleted file mode 100644 index de664ca3c0f..00000000000 --- a/tests/baselines/reference/parserForOfStatement20.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement20.ts === -for (var of = 0 in of) { } ->of : any ->of : any - diff --git a/tests/baselines/reference/parserForOfStatement4.errors.txt b/tests/baselines/reference/parserForOfStatement4.errors.txt new file mode 100644 index 00000000000..65b4bf342f2 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement4.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts(1,10): error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts (1 errors) ==== + for (var a = 1 of X) { + ~ +!!! error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. + } \ No newline at end of file From 7cb2a643503698d3da5469b01d1a8fcd67d2125f Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Tue, 17 Feb 2015 18:16:00 -0800 Subject: [PATCH 10/12] Disallow type annotation on a for-of variable --- src/compiler/checker.ts | 14 +++++++++----- src/compiler/diagnosticInformationMap.generated.ts | 1 + src/compiler/diagnosticMessages.json | 4 ++++ .../reference/parserES5ForOfStatement5.errors.txt | 6 +++--- .../reference/parserForInStatement7.errors.txt | 5 +---- .../reference/parserForOfStatement5.errors.txt | 8 ++++++++ 6 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 tests/baselines/reference/parserForOfStatement5.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 96439b2cf68..aeb2324fcbf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8467,9 +8467,6 @@ module ts { if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; checkVariableDeclaration(decl); - if (decl.type) { - error(decl, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); - } } } else { @@ -10769,11 +10766,18 @@ module ts { Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } - if (variableList.declarations[0].initializer) { + var firstDeclaration = variableList.declarations[0]; + if (firstDeclaration.initializer) { var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; - return grammarErrorOnNode(variableList.declarations[0].name, diagnostic); + return grammarErrorOnNode(firstDeclaration.name, diagnostic); + } + if (firstDeclaration.type) { + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? + Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : + Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + return grammarErrorOnNode(firstDeclaration, diagnostic); } } } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 17c0bec44a3..4d9ac1d91a7 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -317,6 +317,7 @@ module ts { let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2476, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2477, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "For-of statements are only available when targeting ECMAScript 6 or higher" }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b0bf5945e8c..65c73d3ccd4 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1260,6 +1260,10 @@ "category": "Error", "code": 2482 }, + "The left-hand side of a 'for...of' statement cannot use a type annotation.": { + "category": "Error", + "code": 2483 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt index 55c56d60aae..0e88ce6cf36 100644 --- a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,10): error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts (1 errors) ==== for (var a: number of X) { - ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher + ~ +!!! error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement7.errors.txt b/tests/baselines/reference/parserForInStatement7.errors.txt index 397401003db..7c85ce3f795 100644 --- a/tests/baselines/reference/parserForInStatement7.errors.txt +++ b/tests/baselines/reference/parserForInStatement7.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,43): error TS2304: Cannot find name 'X'. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts (2 errors) ==== for (var a: number = 1, b: string = "" in X) { - ~ -!!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. ~ !!! error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. ~ diff --git a/tests/baselines/reference/parserForOfStatement5.errors.txt b/tests/baselines/reference/parserForOfStatement5.errors.txt new file mode 100644 index 00000000000..13fd8739866 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement5.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts(1,10): error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts (1 errors) ==== + for (var a: number of X) { + ~ +!!! error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. + } \ No newline at end of file From 8558d642f3b82c7626634cc3098096c8a3609457 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 18 Feb 2015 11:14:58 -0800 Subject: [PATCH 11/12] Temporarily disallow for-of statements --- src/compiler/checker.ts | 2 ++ src/compiler/diagnosticInformationMap.generated.ts | 3 ++- src/compiler/diagnosticMessages.json | 6 +++++- .../reference/parserES5ForOfStatement1.d.errors.txt | 4 ++-- .../reference/parserES5ForOfStatement10.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement11.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement12.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement13.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement14.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement15.errors.txt | 4 ++-- .../reference/parserES5ForOfStatement16.errors.txt | 4 ++-- .../reference/parserES5ForOfStatement18.errors.txt | 4 ++-- .../reference/parserES5ForOfStatement2.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement21.errors.txt | 9 +++------ .../reference/parserES5ForOfStatement3.errors.txt | 6 +++--- .../reference/parserES5ForOfStatement4.errors.txt | 6 +++--- .../reference/parserES5ForOfStatement5.errors.txt | 6 +++--- .../reference/parserES5ForOfStatement6.errors.txt | 6 +++--- .../reference/parserES5ForOfStatement7.errors.txt | 6 +++--- .../reference/parserES5ForOfStatement8.errors.txt | 4 ++-- .../reference/parserES5ForOfStatement9.errors.txt | 9 +++------ .../reference/parserForOfStatement1.d.errors.txt | 4 ++-- .../reference/parserForOfStatement10.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement10.types | 5 ----- .../reference/parserForOfStatement11.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement11.types | 6 ------ .../reference/parserForOfStatement12.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement12.types | 6 ------ .../reference/parserForOfStatement13.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement13.types | 6 ------ .../reference/parserForOfStatement14.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement14.types | 6 ------ .../reference/parserForOfStatement15.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement15.types | 6 ------ .../reference/parserForOfStatement16.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement16.types | 6 ------ .../reference/parserForOfStatement18.errors.txt | 7 +++++++ tests/baselines/reference/parserForOfStatement18.types | 5 ----- .../baselines/reference/parserForOfStatement2.errors.txt | 6 +++--- .../reference/parserForOfStatement21.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement3.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement4.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement5.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement6.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement7.errors.txt | 6 +++--- .../baselines/reference/parserForOfStatement8.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement8.types | 5 ----- .../baselines/reference/parserForOfStatement9.errors.txt | 8 ++++++++ tests/baselines/reference/parserForOfStatement9.types | 5 ----- 49 files changed, 160 insertions(+), 154 deletions(-) create mode 100644 tests/baselines/reference/parserForOfStatement10.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement10.types create mode 100644 tests/baselines/reference/parserForOfStatement11.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement11.types create mode 100644 tests/baselines/reference/parserForOfStatement12.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement12.types create mode 100644 tests/baselines/reference/parserForOfStatement13.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement13.types create mode 100644 tests/baselines/reference/parserForOfStatement14.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement14.types create mode 100644 tests/baselines/reference/parserForOfStatement15.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement15.types create mode 100644 tests/baselines/reference/parserForOfStatement16.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement16.types create mode 100644 tests/baselines/reference/parserForOfStatement18.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement18.types create mode 100644 tests/baselines/reference/parserForOfStatement8.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement8.types create mode 100644 tests/baselines/reference/parserForOfStatement9.errors.txt delete mode 100644 tests/baselines/reference/parserForOfStatement9.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index aeb2324fcbf..37de87ea83b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10786,6 +10786,8 @@ module ts { } function checkGrammarForOfStatement(forOfStatement: ForOfStatement): boolean { + // Temporarily disallow for-of statements until type check work is complete. + return grammarErrorOnFirstToken(forOfStatement, Diagnostics.For_of_statements_are_not_currently_supported); if (checkGrammarForInOrForOfStatement(forOfStatement)) { return true; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 4d9ac1d91a7..2fbe9b49457 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -316,7 +316,7 @@ module ts { Property_0_does_not_exist_on_const_enum_1: { code: 2475, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2476, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2477, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "For-of statements are only available when targeting ECMAScript 6 or higher" }, + For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "For...of statements are only available when targeting ECMAScript 6 or higher." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -463,5 +463,6 @@ module ts { yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, + For_of_statements_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "For...of statements are not currently supported." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 65c73d3ccd4..1b81d14ffda 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1256,7 +1256,7 @@ "category": "Error", "code": 2477 }, - "For-of statements are only available when targeting ECMAScript 6 or higher": { + "For...of statements are only available when targeting ECMAScript 6 or higher.": { "category": "Error", "code": 2482 }, @@ -1845,5 +1845,9 @@ "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { "category": "Error", "code": 9002 + }, + "For...of statements are not currently supported.": { + "category": "Error", + "code": 9003 } } diff --git a/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt index f3034cd2c27..b5117962a75 100644 --- a/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts (1 errors) ==== for (var i of e) { ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement10.errors.txt b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt index 7fdbe80e12e..7da7a0505e0 100644 --- a/tests/baselines/reference/parserES5ForOfStatement10.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts (1 errors) ==== for (const v of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~~~ -!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement11.errors.txt b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt index 146aff8f91b..f15beaa8f62 100644 --- a/tests/baselines/reference/parserES5ForOfStatement11.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts (1 errors) ==== for (const [a, b] of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~~~ -!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement12.errors.txt b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt index ea1ad1d8eb7..da8836c29d8 100644 --- a/tests/baselines/reference/parserES5ForOfStatement12.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,6): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts (1 errors) ==== for (const {a, b} of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~~~ -!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement13.errors.txt b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt index 27dc44f094a..1f181b16e75 100644 --- a/tests/baselines/reference/parserES5ForOfStatement13.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts (1 errors) ==== for (let {a, b} of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~ -!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement14.errors.txt b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt index 9eba6e25c9a..a1d67e91bce 100644 --- a/tests/baselines/reference/parserES5ForOfStatement14.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts (1 errors) ==== for (let [a, b] of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~ -!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement15.errors.txt b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt index 2f39244ecd5..9c879f7cec4 100644 --- a/tests/baselines/reference/parserES5ForOfStatement15.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts (1 errors) ==== for (var [a, b] of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement16.errors.txt b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt index 80a45c0f8b5..fb0fe1b59cc 100644 --- a/tests/baselines/reference/parserES5ForOfStatement16.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts (1 errors) ==== for (var {a, b} of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement18.errors.txt b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt index e07b516abf0..7ddd631f6ec 100644 --- a/tests/baselines/reference/parserES5ForOfStatement18.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts (1 errors) ==== for (var of of of) { } ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher \ No newline at end of file +!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement2.errors.txt b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt index 70bf84999f5..309b145b84a 100644 --- a/tests/baselines/reference/parserES5ForOfStatement2.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,9): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts (1 errors) ==== for (var of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - -!!! error TS1123: Variable declaration list cannot be empty. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement21.errors.txt b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt index 338d1e34b2f..9bd333c2592 100644 --- a/tests/baselines/reference/parserES5ForOfStatement21.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,9): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts (1 errors) ==== for (var of of) { } ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - -!!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file +!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt index a976d9c0d54..78c0592f12d 100644 --- a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,13): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts (1 errors) ==== for (var a, b of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt index e2b38b56be5..d456dcd2d22 100644 --- a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,10): error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts (1 errors) ==== for (var a = 1 of X) { - ~ -!!! error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt index 0e88ce6cf36..45070d754cc 100644 --- a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,10): error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts (1 errors) ==== for (var a: number of X) { - ~ -!!! error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt index da76589190d..85f2ce11537 100644 --- a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,17): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt index ced399ca103..0dddea7adc6 100644 --- a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,25): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement8.errors.txt b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt index 739369e8f82..8707d03a135 100644 --- a/tests/baselines/reference/parserES5ForOfStatement8.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts (1 errors) ==== for (var v of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement9.errors.txt b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt index c03669fcb98..c41bc180a79 100644 --- a/tests/baselines/reference/parserES5ForOfStatement9.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,1): error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,6): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,1): error TS9003: For...of statements are not currently supported. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts (1 errors) ==== for (let v of X) { ~~~ -!!! error TS2482: For-of statements are only available when targeting ECMAScript 6 or higher - ~~~ -!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement1.d.errors.txt b/tests/baselines/reference/parserForOfStatement1.d.errors.txt index 3b1b2a65922..8961f8b7fbc 100644 --- a/tests/baselines/reference/parserForOfStatement1.d.errors.txt +++ b/tests/baselines/reference/parserForOfStatement1.d.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts (1 errors) ==== for (var i of e) { ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement10.errors.txt b/tests/baselines/reference/parserForOfStatement10.errors.txt new file mode 100644 index 00000000000..71dbd6b9a15 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement10.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts (1 errors) ==== + for (const v of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement10.types b/tests/baselines/reference/parserForOfStatement10.types deleted file mode 100644 index 1707fa934cb..00000000000 --- a/tests/baselines/reference/parserForOfStatement10.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts === -for (const v of X) { ->v : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement11.errors.txt b/tests/baselines/reference/parserForOfStatement11.errors.txt new file mode 100644 index 00000000000..9ed5ad72cf5 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement11.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts (1 errors) ==== + for (const [a, b] of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement11.types b/tests/baselines/reference/parserForOfStatement11.types deleted file mode 100644 index eebc0c6a864..00000000000 --- a/tests/baselines/reference/parserForOfStatement11.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts === -for (const [a, b] of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement12.errors.txt b/tests/baselines/reference/parserForOfStatement12.errors.txt new file mode 100644 index 00000000000..da4a3e9a36d --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement12.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts (1 errors) ==== + for (const {a, b} of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement12.types b/tests/baselines/reference/parserForOfStatement12.types deleted file mode 100644 index 51071059db1..00000000000 --- a/tests/baselines/reference/parserForOfStatement12.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts === -for (const {a, b} of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement13.errors.txt b/tests/baselines/reference/parserForOfStatement13.errors.txt new file mode 100644 index 00000000000..b01f4ecd52b --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement13.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts (1 errors) ==== + for (let {a, b} of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement13.types b/tests/baselines/reference/parserForOfStatement13.types deleted file mode 100644 index 22c7af5605c..00000000000 --- a/tests/baselines/reference/parserForOfStatement13.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts === -for (let {a, b} of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement14.errors.txt b/tests/baselines/reference/parserForOfStatement14.errors.txt new file mode 100644 index 00000000000..2a4b79e35f1 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement14.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts (1 errors) ==== + for (let [a, b] of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement14.types b/tests/baselines/reference/parserForOfStatement14.types deleted file mode 100644 index f255015bb15..00000000000 --- a/tests/baselines/reference/parserForOfStatement14.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts === -for (let [a, b] of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement15.errors.txt b/tests/baselines/reference/parserForOfStatement15.errors.txt new file mode 100644 index 00000000000..920cb21c6e1 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement15.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts (1 errors) ==== + for (var [a, b] of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement15.types b/tests/baselines/reference/parserForOfStatement15.types deleted file mode 100644 index bf6faf3478e..00000000000 --- a/tests/baselines/reference/parserForOfStatement15.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts === -for (var [a, b] of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement16.errors.txt b/tests/baselines/reference/parserForOfStatement16.errors.txt new file mode 100644 index 00000000000..b13c13168bd --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement16.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts (1 errors) ==== + for (var {a, b} of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement16.types b/tests/baselines/reference/parserForOfStatement16.types deleted file mode 100644 index 48476dfae0a..00000000000 --- a/tests/baselines/reference/parserForOfStatement16.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts === -for (var {a, b} of X) { ->a : any ->b : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement18.errors.txt b/tests/baselines/reference/parserForOfStatement18.errors.txt new file mode 100644 index 00000000000..35f63cbd95c --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement18.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts (1 errors) ==== + for (var of of of) { } + ~~~ +!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement18.types b/tests/baselines/reference/parserForOfStatement18.types deleted file mode 100644 index 8e3b52ac877..00000000000 --- a/tests/baselines/reference/parserForOfStatement18.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts === -for (var of of of) { } ->of : any ->of : any - diff --git a/tests/baselines/reference/parserForOfStatement2.errors.txt b/tests/baselines/reference/parserForOfStatement2.errors.txt index 7229fe4196d..88bac913833 100644 --- a/tests/baselines/reference/parserForOfStatement2.errors.txt +++ b/tests/baselines/reference/parserForOfStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts(1,9): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts (1 errors) ==== for (var of X) { - -!!! error TS1123: Variable declaration list cannot be empty. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement21.errors.txt b/tests/baselines/reference/parserForOfStatement21.errors.txt index 9103e2fedee..091a5c116eb 100644 --- a/tests/baselines/reference/parserForOfStatement21.errors.txt +++ b/tests/baselines/reference/parserForOfStatement21.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts(1,9): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts (1 errors) ==== for (var of of) { } - -!!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file + ~~~ +!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement3.errors.txt b/tests/baselines/reference/parserForOfStatement3.errors.txt index 995ef4637c2..18127a69310 100644 --- a/tests/baselines/reference/parserForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,13): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts (1 errors) ==== for (var a, b of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement4.errors.txt b/tests/baselines/reference/parserForOfStatement4.errors.txt index 65b4bf342f2..bee92e3035e 100644 --- a/tests/baselines/reference/parserForOfStatement4.errors.txt +++ b/tests/baselines/reference/parserForOfStatement4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts(1,10): error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts (1 errors) ==== for (var a = 1 of X) { - ~ -!!! error TS1190: The variable declaration of a 'for...of' statement cannot have an initializer. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement5.errors.txt b/tests/baselines/reference/parserForOfStatement5.errors.txt index 13fd8739866..a1cc609fe81 100644 --- a/tests/baselines/reference/parserForOfStatement5.errors.txt +++ b/tests/baselines/reference/parserForOfStatement5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts(1,10): error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts (1 errors) ==== for (var a: number of X) { - ~ -!!! error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement6.errors.txt b/tests/baselines/reference/parserForOfStatement6.errors.txt index 57d95361b65..477544babe9 100644 --- a/tests/baselines/reference/parserForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,17): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement7.errors.txt b/tests/baselines/reference/parserForOfStatement7.errors.txt index 07f93c263ec..c03d9451f5d 100644 --- a/tests/baselines/reference/parserForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,25): error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,1): error TS9003: For...of statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { - ~ -!!! error TS1188: Only a single variable declaration is allowed in a 'for...of' statement. + ~~~ +!!! error TS9003: For...of statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement8.errors.txt b/tests/baselines/reference/parserForOfStatement8.errors.txt new file mode 100644 index 00000000000..1f0e9215584 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement8.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts (1 errors) ==== + for (var v of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement8.types b/tests/baselines/reference/parserForOfStatement8.types deleted file mode 100644 index a4168caf262..00000000000 --- a/tests/baselines/reference/parserForOfStatement8.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts === -for (var v of X) { ->v : any ->X : unknown -} diff --git a/tests/baselines/reference/parserForOfStatement9.errors.txt b/tests/baselines/reference/parserForOfStatement9.errors.txt new file mode 100644 index 00000000000..18f0f41a2e9 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement9.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts(1,1): error TS9003: For...of statements are not currently supported. + + +==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts (1 errors) ==== + for (let v of X) { + ~~~ +!!! error TS9003: For...of statements are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement9.types b/tests/baselines/reference/parserForOfStatement9.types deleted file mode 100644 index 0285a3e4b76..00000000000 --- a/tests/baselines/reference/parserForOfStatement9.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts === -for (let v of X) { ->v : any ->X : unknown -} From 6c32a6aca8c098886b03edb7293ddbc2556206c5 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Wed, 18 Feb 2015 14:39:07 -0800 Subject: [PATCH 12/12] Address feedback --- src/compiler/checker.ts | 61 +++++++++---------- .../diagnosticInformationMap.generated.ts | 4 +- src/compiler/diagnosticMessages.json | 4 +- .../parserES5ForOfStatement1.d.errors.txt | 4 +- .../parserES5ForOfStatement10.errors.txt | 4 +- .../parserES5ForOfStatement11.errors.txt | 4 +- .../parserES5ForOfStatement12.errors.txt | 4 +- .../parserES5ForOfStatement13.errors.txt | 4 +- .../parserES5ForOfStatement14.errors.txt | 4 +- .../parserES5ForOfStatement15.errors.txt | 4 +- .../parserES5ForOfStatement16.errors.txt | 4 +- .../parserES5ForOfStatement18.errors.txt | 4 +- .../parserES5ForOfStatement2.errors.txt | 4 +- .../parserES5ForOfStatement21.errors.txt | 4 +- .../parserES5ForOfStatement3.errors.txt | 4 +- .../parserES5ForOfStatement4.errors.txt | 4 +- .../parserES5ForOfStatement5.errors.txt | 4 +- .../parserES5ForOfStatement6.errors.txt | 4 +- .../parserES5ForOfStatement7.errors.txt | 4 +- .../parserES5ForOfStatement8.errors.txt | 4 +- .../parserES5ForOfStatement9.errors.txt | 4 +- .../parserForOfStatement1.d.errors.txt | 4 +- .../parserForOfStatement10.errors.txt | 4 +- .../parserForOfStatement11.errors.txt | 4 +- .../parserForOfStatement12.errors.txt | 4 +- .../parserForOfStatement13.errors.txt | 4 +- .../parserForOfStatement14.errors.txt | 4 +- .../parserForOfStatement15.errors.txt | 4 +- .../parserForOfStatement16.errors.txt | 4 +- .../parserForOfStatement18.errors.txt | 4 +- .../parserForOfStatement2.errors.txt | 4 +- .../parserForOfStatement21.errors.txt | 4 +- .../parserForOfStatement3.errors.txt | 4 +- .../parserForOfStatement4.errors.txt | 4 +- .../parserForOfStatement5.errors.txt | 4 +- .../parserForOfStatement6.errors.txt | 4 +- .../parserForOfStatement7.errors.txt | 4 +- .../parserForOfStatement8.errors.txt | 4 +- .../parserForOfStatement9.errors.txt | 4 +- 39 files changed, 105 insertions(+), 108 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 37de87ea83b..e94a125faed 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8082,7 +8082,7 @@ module ts { function checkBlock(node: Block) { // Grammar checking for SyntaxKind.Block if (node.kind === SyntaxKind.Block) { - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); } forEach(node.statements, checkSourceElement); @@ -8396,14 +8396,14 @@ module ts { function checkExpressionStatement(node: ExpressionStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node) + checkGrammarStatementInAmbientContext(node) checkExpression(node.expression); } function checkIfStatement(node: IfStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); @@ -8412,7 +8412,7 @@ module ts { function checkDoStatement(node: DoStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkSourceElement(node.statement); checkExpression(node.expression); @@ -8420,7 +8420,7 @@ module ts { function checkWhileStatement(node: WhileStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.statement); @@ -8428,7 +8428,7 @@ module ts { function checkForStatement(node: ForStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { if (node.initializer && node.initializer.kind == SyntaxKind.VariableDeclarationList) { checkGrammarVariableDeclarationList(node.initializer); } @@ -8497,7 +8497,7 @@ module ts { function checkBreakOrContinueStatement(node: BreakOrContinueStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); + checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); // TODO: Check that target label is valid } @@ -8508,7 +8508,7 @@ module ts { function checkReturnStatement(node: ReturnStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { var functionBlock = getContainingFunction(node); if (!functionBlock) { grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); @@ -8539,7 +8539,7 @@ module ts { function checkWithStatement(node: WithStatement) { // Grammar checking for withStatement - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { if (node.parserContextFlags & ParserContextFlags.StrictMode) { grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); } @@ -8551,7 +8551,7 @@ module ts { function checkSwitchStatement(node: SwitchStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); var firstDefaultClause: CaseOrDefaultClause; var hasDuplicateDefaultClause = false; @@ -8588,7 +8588,7 @@ module ts { function checkLabeledStatement(node: LabeledStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { var current = node.parent; while (current) { if (isAnyFunction(current)) { @@ -8609,7 +8609,7 @@ module ts { function checkThrowStatement(node: ThrowStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { if (node.expression === undefined) { grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); } @@ -8622,7 +8622,7 @@ module ts { function checkTryStatement(node: TryStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkBlock(node.tryBlock); var catchClause = node.catchClause; @@ -9480,10 +9480,10 @@ module ts { case SyntaxKind.ExportAssignment: return checkExportAssignment(node); case SyntaxKind.EmptyStatement: - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); return; case SyntaxKind.DebuggerStatement: - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); return; } } @@ -10753,7 +10753,7 @@ module ts { } function checkGrammarForInOrForOfStatement(forInOrOfStatement: ForInStatement | ForOfStatement): boolean { - if (checkGrammarForStatementInAmbientContext(forInOrOfStatement)) { + if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } @@ -10761,22 +10761,22 @@ module ts { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : - Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement + ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement + : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? - Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : - Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement + ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer + : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement ? - Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : - Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + var diagnostic = forInOrOfStatement.kind === SyntaxKind.ForInStatement + ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation + : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); } } @@ -10787,15 +10787,12 @@ module ts { function checkGrammarForOfStatement(forOfStatement: ForOfStatement): boolean { // Temporarily disallow for-of statements until type check work is complete. - return grammarErrorOnFirstToken(forOfStatement, Diagnostics.For_of_statements_are_not_currently_supported); - if (checkGrammarForInOrForOfStatement(forOfStatement)) { - return true; - } + return grammarErrorOnFirstToken(forOfStatement, Diagnostics.for_of_statements_are_not_currently_supported); if (languageVersion < ScriptTarget.ES6) { - return grammarErrorOnFirstToken(forOfStatement, Diagnostics.For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); + return grammarErrorOnFirstToken(forOfStatement, Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); } - return false; + return checkGrammarForInOrForOfStatement(forOfStatement); } function checkGrammarAccessor(accessor: MethodDeclaration): boolean { @@ -11235,7 +11232,7 @@ module ts { return isInAmbientContext(node) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); } - function checkGrammarForStatementInAmbientContext(node: Node): boolean { + function checkGrammarStatementInAmbientContext(node: Node): boolean { if (isInAmbientContext(node)) { // An accessors is already reported about the ambient context if (isAccessor(node.parent.kind)) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 2fbe9b49457..db0058f64db 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -316,7 +316,7 @@ module ts { Property_0_does_not_exist_on_const_enum_1: { code: 2475, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2476, category: DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2477, category: DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - For_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "For...of statements are only available when targeting ECMAScript 6 or higher." }, + for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: DiagnosticCategory.Error, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -463,6 +463,6 @@ module ts { yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." }, - For_of_statements_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "For...of statements are not currently supported." }, + for_of_statements_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "'for...of' statements are not currently supported." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 1b81d14ffda..0ba9c6729f3 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1256,7 +1256,7 @@ "category": "Error", "code": 2477 }, - "For...of statements are only available when targeting ECMAScript 6 or higher.": { + "'for...of' statements are only available when targeting ECMAScript 6 or higher.": { "category": "Error", "code": 2482 }, @@ -1846,7 +1846,7 @@ "category": "Error", "code": 9002 }, - "For...of statements are not currently supported.": { + "'for...of' statements are not currently supported.": { "category": "Error", "code": 9003 } diff --git a/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt index b5117962a75..9c1a39b1f4a 100644 --- a/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement1.d.ts (1 errors) ==== for (var i of e) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement10.errors.txt b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt index 7da7a0505e0..d7f411b1879 100644 --- a/tests/baselines/reference/parserES5ForOfStatement10.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement10.ts (1 errors) ==== for (const v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement11.errors.txt b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt index f15beaa8f62..48805a336c7 100644 --- a/tests/baselines/reference/parserES5ForOfStatement11.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement11.ts (1 errors) ==== for (const [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement12.errors.txt b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt index da8836c29d8..3b9f242b975 100644 --- a/tests/baselines/reference/parserES5ForOfStatement12.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement12.ts (1 errors) ==== for (const {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement13.errors.txt b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt index 1f181b16e75..8b8c8ce0868 100644 --- a/tests/baselines/reference/parserES5ForOfStatement13.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement13.ts (1 errors) ==== for (let {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement14.errors.txt b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt index a1d67e91bce..dc4db95270a 100644 --- a/tests/baselines/reference/parserES5ForOfStatement14.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement14.ts (1 errors) ==== for (let [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement15.errors.txt b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt index 9c879f7cec4..07aa6dd5b37 100644 --- a/tests/baselines/reference/parserES5ForOfStatement15.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement15.ts (1 errors) ==== for (var [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement16.errors.txt b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt index fb0fe1b59cc..15a3e4f7f0b 100644 --- a/tests/baselines/reference/parserES5ForOfStatement16.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement16.ts (1 errors) ==== for (var {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement18.errors.txt b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt index 7ddd631f6ec..fc314e51012 100644 --- a/tests/baselines/reference/parserES5ForOfStatement18.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts (1 errors) ==== for (var of of of) { } ~~~ -!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file +!!! error TS9003: 'for...of' statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement2.errors.txt b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt index 309b145b84a..347ae29ddb8 100644 --- a/tests/baselines/reference/parserES5ForOfStatement2.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement2.ts (1 errors) ==== for (var of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement21.errors.txt b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt index 9bd333c2592..2ddbf4b5666 100644 --- a/tests/baselines/reference/parserES5ForOfStatement21.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement21.ts (1 errors) ==== for (var of of) { } ~~~ -!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file +!!! error TS9003: 'for...of' statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt index 78c0592f12d..553ca40aee0 100644 --- a/tests/baselines/reference/parserES5ForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement3.ts (1 errors) ==== for (var a, b of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt index d456dcd2d22..6a08c8942ed 100644 --- a/tests/baselines/reference/parserES5ForOfStatement4.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement4.ts (1 errors) ==== for (var a = 1 of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt index 45070d754cc..212eae8ac10 100644 --- a/tests/baselines/reference/parserES5ForOfStatement5.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement5.ts (1 errors) ==== for (var a: number of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt index 85f2ce11537..e331b66eb85 100644 --- a/tests/baselines/reference/parserES5ForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt index 0dddea7adc6..5ba60c264eb 100644 --- a/tests/baselines/reference/parserES5ForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement8.errors.txt b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt index 8707d03a135..3696bf11f8c 100644 --- a/tests/baselines/reference/parserES5ForOfStatement8.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement8.ts (1 errors) ==== for (var v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ForOfStatement9.errors.txt b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt index c41bc180a79..6e2e9d05705 100644 --- a/tests/baselines/reference/parserES5ForOfStatement9.errors.txt +++ b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement9.ts (1 errors) ==== for (let v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement1.d.errors.txt b/tests/baselines/reference/parserForOfStatement1.d.errors.txt index 8961f8b7fbc..05af0a6f775 100644 --- a/tests/baselines/reference/parserForOfStatement1.d.errors.txt +++ b/tests/baselines/reference/parserForOfStatement1.d.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement1.d.ts (1 errors) ==== for (var i of e) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement10.errors.txt b/tests/baselines/reference/parserForOfStatement10.errors.txt index 71dbd6b9a15..570c319b51f 100644 --- a/tests/baselines/reference/parserForOfStatement10.errors.txt +++ b/tests/baselines/reference/parserForOfStatement10.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement10.ts (1 errors) ==== for (const v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement11.errors.txt b/tests/baselines/reference/parserForOfStatement11.errors.txt index 9ed5ad72cf5..f253a2d4295 100644 --- a/tests/baselines/reference/parserForOfStatement11.errors.txt +++ b/tests/baselines/reference/parserForOfStatement11.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement11.ts (1 errors) ==== for (const [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement12.errors.txt b/tests/baselines/reference/parserForOfStatement12.errors.txt index da4a3e9a36d..07ef4498984 100644 --- a/tests/baselines/reference/parserForOfStatement12.errors.txt +++ b/tests/baselines/reference/parserForOfStatement12.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement12.ts (1 errors) ==== for (const {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement13.errors.txt b/tests/baselines/reference/parserForOfStatement13.errors.txt index b01f4ecd52b..6c10a7b0582 100644 --- a/tests/baselines/reference/parserForOfStatement13.errors.txt +++ b/tests/baselines/reference/parserForOfStatement13.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement13.ts (1 errors) ==== for (let {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement14.errors.txt b/tests/baselines/reference/parserForOfStatement14.errors.txt index 2a4b79e35f1..209a39c0513 100644 --- a/tests/baselines/reference/parserForOfStatement14.errors.txt +++ b/tests/baselines/reference/parserForOfStatement14.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement14.ts (1 errors) ==== for (let [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement15.errors.txt b/tests/baselines/reference/parserForOfStatement15.errors.txt index 920cb21c6e1..c5fd77af299 100644 --- a/tests/baselines/reference/parserForOfStatement15.errors.txt +++ b/tests/baselines/reference/parserForOfStatement15.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement15.ts (1 errors) ==== for (var [a, b] of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement16.errors.txt b/tests/baselines/reference/parserForOfStatement16.errors.txt index b13c13168bd..d169eef1256 100644 --- a/tests/baselines/reference/parserForOfStatement16.errors.txt +++ b/tests/baselines/reference/parserForOfStatement16.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement16.ts (1 errors) ==== for (var {a, b} of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement18.errors.txt b/tests/baselines/reference/parserForOfStatement18.errors.txt index 35f63cbd95c..9312af76fc1 100644 --- a/tests/baselines/reference/parserForOfStatement18.errors.txt +++ b/tests/baselines/reference/parserForOfStatement18.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts (1 errors) ==== for (var of of of) { } ~~~ -!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file +!!! error TS9003: 'for...of' statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement2.errors.txt b/tests/baselines/reference/parserForOfStatement2.errors.txt index 88bac913833..8e7da497308 100644 --- a/tests/baselines/reference/parserForOfStatement2.errors.txt +++ b/tests/baselines/reference/parserForOfStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement2.ts (1 errors) ==== for (var of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement21.errors.txt b/tests/baselines/reference/parserForOfStatement21.errors.txt index 091a5c116eb..dad48f415cd 100644 --- a/tests/baselines/reference/parserForOfStatement21.errors.txt +++ b/tests/baselines/reference/parserForOfStatement21.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement21.ts (1 errors) ==== for (var of of) { } ~~~ -!!! error TS9003: For...of statements are not currently supported. \ No newline at end of file +!!! error TS9003: 'for...of' statements are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement3.errors.txt b/tests/baselines/reference/parserForOfStatement3.errors.txt index 18127a69310..83985f1a710 100644 --- a/tests/baselines/reference/parserForOfStatement3.errors.txt +++ b/tests/baselines/reference/parserForOfStatement3.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement3.ts (1 errors) ==== for (var a, b of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement4.errors.txt b/tests/baselines/reference/parserForOfStatement4.errors.txt index bee92e3035e..94dd08ed597 100644 --- a/tests/baselines/reference/parserForOfStatement4.errors.txt +++ b/tests/baselines/reference/parserForOfStatement4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement4.ts (1 errors) ==== for (var a = 1 of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement5.errors.txt b/tests/baselines/reference/parserForOfStatement5.errors.txt index a1cc609fe81..6570f4a0755 100644 --- a/tests/baselines/reference/parserForOfStatement5.errors.txt +++ b/tests/baselines/reference/parserForOfStatement5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement5.ts (1 errors) ==== for (var a: number of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement6.errors.txt b/tests/baselines/reference/parserForOfStatement6.errors.txt index 477544babe9..6208749911f 100644 --- a/tests/baselines/reference/parserForOfStatement6.errors.txt +++ b/tests/baselines/reference/parserForOfStatement6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement6.ts (1 errors) ==== for (var a = 1, b = 2 of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement7.errors.txt b/tests/baselines/reference/parserForOfStatement7.errors.txt index c03d9451f5d..1810daad5ee 100644 --- a/tests/baselines/reference/parserForOfStatement7.errors.txt +++ b/tests/baselines/reference/parserForOfStatement7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement7.ts (1 errors) ==== for (var a: number = 1, b: string = "" of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement8.errors.txt b/tests/baselines/reference/parserForOfStatement8.errors.txt index 1f0e9215584..8e2c41d0cef 100644 --- a/tests/baselines/reference/parserForOfStatement8.errors.txt +++ b/tests/baselines/reference/parserForOfStatement8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement8.ts (1 errors) ==== for (var v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForOfStatement9.errors.txt b/tests/baselines/reference/parserForOfStatement9.errors.txt index 18f0f41a2e9..01fd729e9cd 100644 --- a/tests/baselines/reference/parserForOfStatement9.errors.txt +++ b/tests/baselines/reference/parserForOfStatement9.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts(1,1): error TS9003: For...of statements are not currently supported. +tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts(1,1): error TS9003: 'for...of' statements are not currently supported. ==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement9.ts (1 errors) ==== for (let v of X) { ~~~ -!!! error TS9003: For...of statements are not currently supported. +!!! error TS9003: 'for...of' statements are not currently supported. } \ No newline at end of file