diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 87b0bd86d20..57697d77216 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -489,6 +489,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 aab9f49eae6..5f93fe82786 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4642,6 +4642,7 @@ module ts { case SyntaxKind.WhileStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ReturnStatement: case SyntaxKind.WithStatement: case SyntaxKind.SwitchStatement: @@ -8237,7 +8238,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); @@ -8553,14 +8554,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); @@ -8569,7 +8570,7 @@ module ts { function checkDoStatement(node: DoStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkSourceElement(node.statement); checkExpression(node.expression); @@ -8577,7 +8578,7 @@ module ts { function checkWhileStatement(node: WhileStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.statement); @@ -8585,7 +8586,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); } @@ -8605,18 +8606,14 @@ module ts { checkSourceElement(node.statement); } + function checkForOfStatement(node: ForOfStatement) { + // TODO: not yet implemented + 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 @@ -8628,9 +8625,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 { @@ -8661,7 +8655,7 @@ module ts { function checkBreakOrContinueStatement(node: BreakOrContinueStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); + checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); // TODO: Check that target label is valid } @@ -8672,7 +8666,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); @@ -8703,7 +8697,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); } @@ -8715,7 +8709,7 @@ module ts { function checkSwitchStatement(node: SwitchStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); var firstDefaultClause: CaseOrDefaultClause; var hasDuplicateDefaultClause = false; @@ -8752,7 +8746,7 @@ module ts { function checkLabeledStatement(node: LabeledStatement) { // Grammar checking - if (!checkGrammarForStatementInAmbientContext(node)) { + if (!checkGrammarStatementInAmbientContext(node)) { var current = node.parent; while (current) { if (isAnyFunction(current)) { @@ -8773,7 +8767,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); } @@ -8786,7 +8780,7 @@ module ts { function checkTryStatement(node: TryStatement) { // Grammar checking - checkGrammarForStatementInAmbientContext(node); + checkGrammarStatementInAmbientContext(node); checkBlock(node.tryBlock); var catchClause = node.catchClause; @@ -9609,6 +9603,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); @@ -9643,10 +9639,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; } } @@ -9718,6 +9714,7 @@ module ts { case SyntaxKind.WhileStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: case SyntaxKind.ReturnStatement: @@ -10928,6 +10925,49 @@ module ts { } } + function checkGrammarForInOrForOfStatement(forInOrOfStatement: ForInStatement | ForOfStatement): boolean { + if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { + return true; + } + + if (forInOrOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList) { + 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; + 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; + 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); + } + } + } + + return false; + } + + 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 (languageVersion < ScriptTarget.ES6) { + return grammarErrorOnFirstToken(forOfStatement, Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); + } + + return checkGrammarForInOrForOfStatement(forOfStatement); + } + function checkGrammarAccessor(accessor: MethodDeclaration): boolean { var kind = accessor.kind; if (languageVersion < ScriptTarget.ES5) { @@ -11020,6 +11060,7 @@ module ts { switch (node.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: return true; @@ -11176,6 +11217,7 @@ module ts { case SyntaxKind.WithStatement: case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: return false; case SyntaxKind.LabeledStatement: return allowLetAndConstDeclarations(parent.parent); @@ -11366,7 +11408,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 386d4300ade..48c4f597ad7 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -147,6 +147,9 @@ 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." }, + 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." }, @@ -317,6 +320,8 @@ module ts { Property_0_does_not_exist_on_const_enum_1: { code: 2479, 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: 2480, 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: 2481, 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}'." }, @@ -462,5 +467,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 37a67c94a2b..f124fa53717 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -579,6 +579,18 @@ "category": "Error", "code": 1187 }, + "Only a single variable declaration is allowed in a 'for...of' statement.": { + "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", @@ -1260,6 +1272,14 @@ "category": "Error", "code": 2481 }, + "'for...of' statements are only available when targeting ECMAScript 6 or higher.": { + "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", @@ -1536,7 +1556,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 @@ -1841,5 +1861,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/src/compiler/emitter.ts b/src/compiler/emitter.ts index ddf17f8d0d6..62910c184aa 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2915,7 +2915,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); @@ -2936,7 +2936,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); @@ -4355,8 +4361,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 9b3c01cf0f0..95e1ea5de00 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); @@ -1598,8 +1602,8 @@ 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) { + // are done if we see an 'in' keyword in front of us. Same with for-of + if (isInOrOfKeyword(token)) { return true; } @@ -1877,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: @@ -3161,6 +3166,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 @@ -3790,7 +3799,7 @@ module ts { return finishNode(node); } - function parseForOrForInStatement(): Statement { + function parseForOrForInOrForOfStatement(): Statement { var pos = getNodePos(); parseExpected(SyntaxKind.ForKeyword); parseExpected(SyntaxKind.OpenParenToken); @@ -3798,21 +3807,27 @@ 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); } } - 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); @@ -3824,12 +3839,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 { @@ -4075,7 +4090,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: @@ -4217,11 +4232,13 @@ 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); } - function parseVariableDeclarationList(disallowIn: boolean): VariableDeclarationList { + function parseVariableDeclarationList(inForStatementInitializer: boolean): VariableDeclarationList { var node = createNode(SyntaxKind.VariableDeclarationList); switch (token) { @@ -4238,20 +4255,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/src/compiler/scanner.ts b/src/compiler/scanner.ts index f85df69f026..029158b989a 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -94,6 +94,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 72ef66e3fe1..b396a0673aa 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -142,7 +142,7 @@ module ts { StringKeyword, SymbolKeyword, TypeKeyword, - + OfKeyword, // Parse tree nodes // Names @@ -211,6 +211,7 @@ module ts { WhileStatement, ForStatement, ForInStatement, + ForOfStatement, ContinueStatement, BreakStatement, ReturnStatement, @@ -260,7 +261,7 @@ module ts { FirstReservedWord = BreakKeyword, LastReservedWord = WithKeyword, FirstKeyword = BreakKeyword, - LastKeyword = TypeKeyword, + LastKeyword = OfKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypeReference, @@ -753,6 +754,11 @@ module ts { expression: Expression; } + export interface ForOfStatement extends IterationStatement { + initializer: VariableDeclarationList | Expression; + expression: Expression; + } + export interface BreakOrContinueStatement extends Statement { label?: Identifier; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 0656bed7d5f..0aadd16ebdd 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 b4d53984307..6bb1c3108d1 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)) { diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 8afa0a5b939..09c3bb32264 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -181,105 +181,107 @@ declare module "typescript" { StringKeyword = 119, SymbolKeyword = 120, TypeKeyword = 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, - ContinueStatement = 180, - BreakStatement = 181, - ReturnStatement = 182, - WithStatement = 183, - SwitchStatement = 184, - LabeledStatement = 185, - ThrowStatement = 186, - TryStatement = 187, - DebuggerStatement = 188, - VariableDeclaration = 189, - VariableDeclarationList = 190, - FunctionDeclaration = 191, - ClassDeclaration = 192, - InterfaceDeclaration = 193, - TypeAliasDeclaration = 194, - EnumDeclaration = 195, - ModuleDeclaration = 196, - ModuleBlock = 197, - ImportDeclaration = 198, - ExportAssignment = 199, - ExternalModuleReference = 200, - CaseClause = 201, - DefaultClause = 202, - HeritageClause = 203, - CatchClause = 204, - PropertyAssignment = 205, - ShorthandPropertyAssignment = 206, - EnumMember = 207, - SourceFile = 208, - SyntaxList = 209, - Count = 210, + OfKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ForOfStatement = 181, + ContinueStatement = 182, + BreakStatement = 183, + ReturnStatement = 184, + WithStatement = 185, + SwitchStatement = 186, + LabeledStatement = 187, + ThrowStatement = 188, + TryStatement = 189, + DebuggerStatement = 190, + VariableDeclaration = 191, + VariableDeclarationList = 192, + FunctionDeclaration = 193, + ClassDeclaration = 194, + InterfaceDeclaration = 195, + TypeAliasDeclaration = 196, + EnumDeclaration = 197, + ModuleDeclaration = 198, + ModuleBlock = 199, + ImportDeclaration = 200, + ExportAssignment = 201, + ExternalModuleReference = 202, + CaseClause = 203, + DefaultClause = 204, + HeritageClause = 205, + CatchClause = 206, + PropertyAssignment = 207, + ShorthandPropertyAssignment = 208, + EnumMember = 209, + SourceFile = 210, + SyntaxList = 211, + Count = 212, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 121, + LastKeyword = 122, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 136, - LastTypeNode = 144, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -292,7 +294,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 122, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -623,6 +625,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 e2ccc04a7c3..425e3b5a1ea 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -559,271 +559,277 @@ declare module "typescript" { TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 122, + OfKeyword = 122, +>OfKeyword : SyntaxKind + + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 123, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 124, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 125, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 126, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 127, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 128, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 129, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 130, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 131, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 132, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 133, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 134, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 135, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 136, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 137, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 138, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 139, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 140, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 141, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 142, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 143, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 144, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 145, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 146, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 147, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 148, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 149, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 150, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 151, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 152, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 153, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 154, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 155, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 156, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 157, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 158, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 159, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 160, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 161, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 162, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 163, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 164, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 165, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 166, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 167, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 168, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 169, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 170, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 171, + Block = 172, >Block : SyntaxKind - VariableStatement = 172, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 173, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 174, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 175, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 176, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 177, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 178, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 179, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 180, + ForOfStatement = 181, +>ForOfStatement : SyntaxKind + + ContinueStatement = 182, >ContinueStatement : SyntaxKind - BreakStatement = 181, + BreakStatement = 183, >BreakStatement : SyntaxKind - ReturnStatement = 182, + ReturnStatement = 184, >ReturnStatement : SyntaxKind - WithStatement = 183, + WithStatement = 185, >WithStatement : SyntaxKind - SwitchStatement = 184, + SwitchStatement = 186, >SwitchStatement : SyntaxKind - LabeledStatement = 185, + LabeledStatement = 187, >LabeledStatement : SyntaxKind - ThrowStatement = 186, + ThrowStatement = 188, >ThrowStatement : SyntaxKind - TryStatement = 187, + TryStatement = 189, >TryStatement : SyntaxKind - DebuggerStatement = 188, + DebuggerStatement = 190, >DebuggerStatement : SyntaxKind - VariableDeclaration = 189, + VariableDeclaration = 191, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 190, + VariableDeclarationList = 192, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 191, + FunctionDeclaration = 193, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 192, + ClassDeclaration = 194, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 193, + InterfaceDeclaration = 195, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 194, + TypeAliasDeclaration = 196, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 195, + EnumDeclaration = 197, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 196, + ModuleDeclaration = 198, >ModuleDeclaration : SyntaxKind - ModuleBlock = 197, + ModuleBlock = 199, >ModuleBlock : SyntaxKind - ImportDeclaration = 198, + ImportDeclaration = 200, >ImportDeclaration : SyntaxKind - ExportAssignment = 199, + ExportAssignment = 201, >ExportAssignment : SyntaxKind - ExternalModuleReference = 200, + ExternalModuleReference = 202, >ExternalModuleReference : SyntaxKind - CaseClause = 201, + CaseClause = 203, >CaseClause : SyntaxKind - DefaultClause = 202, + DefaultClause = 204, >DefaultClause : SyntaxKind - HeritageClause = 203, + HeritageClause = 205, >HeritageClause : SyntaxKind - CatchClause = 204, + CatchClause = 206, >CatchClause : SyntaxKind - PropertyAssignment = 205, + PropertyAssignment = 207, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 206, + ShorthandPropertyAssignment = 208, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 207, + EnumMember = 209, >EnumMember : SyntaxKind - SourceFile = 208, + SourceFile = 210, >SourceFile : SyntaxKind - SyntaxList = 209, + SyntaxList = 211, >SyntaxList : SyntaxKind - Count = 210, + Count = 212, >Count : SyntaxKind FirstAssignment = 52, @@ -841,7 +847,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 121, + LastKeyword = 122, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -850,10 +856,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 136, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 144, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -892,7 +898,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 122, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1873,6 +1879,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 74ec089e0d0..711a780d530 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -212,105 +212,107 @@ declare module "typescript" { StringKeyword = 119, SymbolKeyword = 120, TypeKeyword = 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, - ContinueStatement = 180, - BreakStatement = 181, - ReturnStatement = 182, - WithStatement = 183, - SwitchStatement = 184, - LabeledStatement = 185, - ThrowStatement = 186, - TryStatement = 187, - DebuggerStatement = 188, - VariableDeclaration = 189, - VariableDeclarationList = 190, - FunctionDeclaration = 191, - ClassDeclaration = 192, - InterfaceDeclaration = 193, - TypeAliasDeclaration = 194, - EnumDeclaration = 195, - ModuleDeclaration = 196, - ModuleBlock = 197, - ImportDeclaration = 198, - ExportAssignment = 199, - ExternalModuleReference = 200, - CaseClause = 201, - DefaultClause = 202, - HeritageClause = 203, - CatchClause = 204, - PropertyAssignment = 205, - ShorthandPropertyAssignment = 206, - EnumMember = 207, - SourceFile = 208, - SyntaxList = 209, - Count = 210, + OfKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ForOfStatement = 181, + ContinueStatement = 182, + BreakStatement = 183, + ReturnStatement = 184, + WithStatement = 185, + SwitchStatement = 186, + LabeledStatement = 187, + ThrowStatement = 188, + TryStatement = 189, + DebuggerStatement = 190, + VariableDeclaration = 191, + VariableDeclarationList = 192, + FunctionDeclaration = 193, + ClassDeclaration = 194, + InterfaceDeclaration = 195, + TypeAliasDeclaration = 196, + EnumDeclaration = 197, + ModuleDeclaration = 198, + ModuleBlock = 199, + ImportDeclaration = 200, + ExportAssignment = 201, + ExternalModuleReference = 202, + CaseClause = 203, + DefaultClause = 204, + HeritageClause = 205, + CatchClause = 206, + PropertyAssignment = 207, + ShorthandPropertyAssignment = 208, + EnumMember = 209, + SourceFile = 210, + SyntaxList = 211, + Count = 212, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 121, + LastKeyword = 122, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 136, - LastTypeNode = 144, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -323,7 +325,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 122, + FirstNode = 123, } 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; } @@ -1978,24 +1984,24 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 178 /* ForStatement */: - case 179 /* ForInStatement */: - case 177 /* WhileStatement */: - case 176 /* DoStatement */: - if (node.statement.kind !== 171 /* Block */) { + case 179 /* ForStatement */: + case 180 /* ForInStatement */: + case 178 /* WhileStatement */: + case 177 /* DoStatement */: + if (node.statement.kind !== 172 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 175 /* IfStatement */: + case 176 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 171 /* Block */) { + if (ifStatement.thenStatement.kind !== 172 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 171 /* Block */ && ifStatement.elseStatement.kind !== 175 /* IfStatement */) { + if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 172 /* Block */ && ifStatement.elseStatement.kind !== 176 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 164 /* BinaryExpression */: + case 165 /* 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 3e750b03148..42ef1b57179 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -703,271 +703,277 @@ declare module "typescript" { TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 122, + OfKeyword = 122, +>OfKeyword : SyntaxKind + + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 123, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 124, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 125, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 126, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 127, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 128, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 129, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 130, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 131, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 132, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 133, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 134, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 135, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 136, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 137, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 138, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 139, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 140, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 141, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 142, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 143, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 144, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 145, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 146, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 147, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 148, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 149, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 150, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 151, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 152, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 153, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 154, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 155, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 156, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 157, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 158, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 159, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 160, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 161, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 162, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 163, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 164, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 165, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 166, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 167, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 168, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 169, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 170, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 171, + Block = 172, >Block : SyntaxKind - VariableStatement = 172, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 173, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 174, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 175, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 176, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 177, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 178, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 179, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 180, + ForOfStatement = 181, +>ForOfStatement : SyntaxKind + + ContinueStatement = 182, >ContinueStatement : SyntaxKind - BreakStatement = 181, + BreakStatement = 183, >BreakStatement : SyntaxKind - ReturnStatement = 182, + ReturnStatement = 184, >ReturnStatement : SyntaxKind - WithStatement = 183, + WithStatement = 185, >WithStatement : SyntaxKind - SwitchStatement = 184, + SwitchStatement = 186, >SwitchStatement : SyntaxKind - LabeledStatement = 185, + LabeledStatement = 187, >LabeledStatement : SyntaxKind - ThrowStatement = 186, + ThrowStatement = 188, >ThrowStatement : SyntaxKind - TryStatement = 187, + TryStatement = 189, >TryStatement : SyntaxKind - DebuggerStatement = 188, + DebuggerStatement = 190, >DebuggerStatement : SyntaxKind - VariableDeclaration = 189, + VariableDeclaration = 191, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 190, + VariableDeclarationList = 192, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 191, + FunctionDeclaration = 193, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 192, + ClassDeclaration = 194, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 193, + InterfaceDeclaration = 195, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 194, + TypeAliasDeclaration = 196, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 195, + EnumDeclaration = 197, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 196, + ModuleDeclaration = 198, >ModuleDeclaration : SyntaxKind - ModuleBlock = 197, + ModuleBlock = 199, >ModuleBlock : SyntaxKind - ImportDeclaration = 198, + ImportDeclaration = 200, >ImportDeclaration : SyntaxKind - ExportAssignment = 199, + ExportAssignment = 201, >ExportAssignment : SyntaxKind - ExternalModuleReference = 200, + ExternalModuleReference = 202, >ExternalModuleReference : SyntaxKind - CaseClause = 201, + CaseClause = 203, >CaseClause : SyntaxKind - DefaultClause = 202, + DefaultClause = 204, >DefaultClause : SyntaxKind - HeritageClause = 203, + HeritageClause = 205, >HeritageClause : SyntaxKind - CatchClause = 204, + CatchClause = 206, >CatchClause : SyntaxKind - PropertyAssignment = 205, + PropertyAssignment = 207, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 206, + ShorthandPropertyAssignment = 208, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 207, + EnumMember = 209, >EnumMember : SyntaxKind - SourceFile = 208, + SourceFile = 210, >SourceFile : SyntaxKind - SyntaxList = 209, + SyntaxList = 211, >SyntaxList : SyntaxKind - Count = 210, + Count = 212, >Count : SyntaxKind FirstAssignment = 52, @@ -985,7 +991,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 121, + LastKeyword = 122, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -994,10 +1000,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 136, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 144, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1036,7 +1042,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 122, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2017,6 +2023,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 22f50173a4f..ee382329e6b 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -213,105 +213,107 @@ declare module "typescript" { StringKeyword = 119, SymbolKeyword = 120, TypeKeyword = 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, - ContinueStatement = 180, - BreakStatement = 181, - ReturnStatement = 182, - WithStatement = 183, - SwitchStatement = 184, - LabeledStatement = 185, - ThrowStatement = 186, - TryStatement = 187, - DebuggerStatement = 188, - VariableDeclaration = 189, - VariableDeclarationList = 190, - FunctionDeclaration = 191, - ClassDeclaration = 192, - InterfaceDeclaration = 193, - TypeAliasDeclaration = 194, - EnumDeclaration = 195, - ModuleDeclaration = 196, - ModuleBlock = 197, - ImportDeclaration = 198, - ExportAssignment = 199, - ExternalModuleReference = 200, - CaseClause = 201, - DefaultClause = 202, - HeritageClause = 203, - CatchClause = 204, - PropertyAssignment = 205, - ShorthandPropertyAssignment = 206, - EnumMember = 207, - SourceFile = 208, - SyntaxList = 209, - Count = 210, + OfKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ForOfStatement = 181, + ContinueStatement = 182, + BreakStatement = 183, + ReturnStatement = 184, + WithStatement = 185, + SwitchStatement = 186, + LabeledStatement = 187, + ThrowStatement = 188, + TryStatement = 189, + DebuggerStatement = 190, + VariableDeclaration = 191, + VariableDeclarationList = 192, + FunctionDeclaration = 193, + ClassDeclaration = 194, + InterfaceDeclaration = 195, + TypeAliasDeclaration = 196, + EnumDeclaration = 197, + ModuleDeclaration = 198, + ModuleBlock = 199, + ImportDeclaration = 200, + ExportAssignment = 201, + ExternalModuleReference = 202, + CaseClause = 203, + DefaultClause = 204, + HeritageClause = 205, + CatchClause = 206, + PropertyAssignment = 207, + ShorthandPropertyAssignment = 208, + EnumMember = 209, + SourceFile = 210, + SyntaxList = 211, + Count = 212, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 121, + LastKeyword = 122, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 136, - LastTypeNode = 144, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -324,7 +326,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 122, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -655,6 +657,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 d2cfc6f633b..6f5f366a4c5 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -655,271 +655,277 @@ declare module "typescript" { TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 122, + OfKeyword = 122, +>OfKeyword : SyntaxKind + + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 123, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 124, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 125, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 126, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 127, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 128, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 129, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 130, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 131, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 132, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 133, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 134, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 135, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 136, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 137, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 138, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 139, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 140, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 141, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 142, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 143, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 144, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 145, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 146, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 147, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 148, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 149, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 150, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 151, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 152, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 153, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 154, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 155, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 156, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 157, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 158, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 159, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 160, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 161, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 162, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 163, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 164, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 165, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 166, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 167, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 168, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 169, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 170, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 171, + Block = 172, >Block : SyntaxKind - VariableStatement = 172, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 173, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 174, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 175, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 176, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 177, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 178, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 179, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 180, + ForOfStatement = 181, +>ForOfStatement : SyntaxKind + + ContinueStatement = 182, >ContinueStatement : SyntaxKind - BreakStatement = 181, + BreakStatement = 183, >BreakStatement : SyntaxKind - ReturnStatement = 182, + ReturnStatement = 184, >ReturnStatement : SyntaxKind - WithStatement = 183, + WithStatement = 185, >WithStatement : SyntaxKind - SwitchStatement = 184, + SwitchStatement = 186, >SwitchStatement : SyntaxKind - LabeledStatement = 185, + LabeledStatement = 187, >LabeledStatement : SyntaxKind - ThrowStatement = 186, + ThrowStatement = 188, >ThrowStatement : SyntaxKind - TryStatement = 187, + TryStatement = 189, >TryStatement : SyntaxKind - DebuggerStatement = 188, + DebuggerStatement = 190, >DebuggerStatement : SyntaxKind - VariableDeclaration = 189, + VariableDeclaration = 191, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 190, + VariableDeclarationList = 192, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 191, + FunctionDeclaration = 193, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 192, + ClassDeclaration = 194, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 193, + InterfaceDeclaration = 195, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 194, + TypeAliasDeclaration = 196, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 195, + EnumDeclaration = 197, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 196, + ModuleDeclaration = 198, >ModuleDeclaration : SyntaxKind - ModuleBlock = 197, + ModuleBlock = 199, >ModuleBlock : SyntaxKind - ImportDeclaration = 198, + ImportDeclaration = 200, >ImportDeclaration : SyntaxKind - ExportAssignment = 199, + ExportAssignment = 201, >ExportAssignment : SyntaxKind - ExternalModuleReference = 200, + ExternalModuleReference = 202, >ExternalModuleReference : SyntaxKind - CaseClause = 201, + CaseClause = 203, >CaseClause : SyntaxKind - DefaultClause = 202, + DefaultClause = 204, >DefaultClause : SyntaxKind - HeritageClause = 203, + HeritageClause = 205, >HeritageClause : SyntaxKind - CatchClause = 204, + CatchClause = 206, >CatchClause : SyntaxKind - PropertyAssignment = 205, + PropertyAssignment = 207, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 206, + ShorthandPropertyAssignment = 208, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 207, + EnumMember = 209, >EnumMember : SyntaxKind - SourceFile = 208, + SourceFile = 210, >SourceFile : SyntaxKind - SyntaxList = 209, + SyntaxList = 211, >SyntaxList : SyntaxKind - Count = 210, + Count = 212, >Count : SyntaxKind FirstAssignment = 52, @@ -937,7 +943,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 121, + LastKeyword = 122, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -946,10 +952,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 136, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 144, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -988,7 +994,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 122, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1969,6 +1975,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 158562aeaf8..0888faddac3 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -250,105 +250,107 @@ declare module "typescript" { StringKeyword = 119, SymbolKeyword = 120, TypeKeyword = 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, - ContinueStatement = 180, - BreakStatement = 181, - ReturnStatement = 182, - WithStatement = 183, - SwitchStatement = 184, - LabeledStatement = 185, - ThrowStatement = 186, - TryStatement = 187, - DebuggerStatement = 188, - VariableDeclaration = 189, - VariableDeclarationList = 190, - FunctionDeclaration = 191, - ClassDeclaration = 192, - InterfaceDeclaration = 193, - TypeAliasDeclaration = 194, - EnumDeclaration = 195, - ModuleDeclaration = 196, - ModuleBlock = 197, - ImportDeclaration = 198, - ExportAssignment = 199, - ExternalModuleReference = 200, - CaseClause = 201, - DefaultClause = 202, - HeritageClause = 203, - CatchClause = 204, - PropertyAssignment = 205, - ShorthandPropertyAssignment = 206, - EnumMember = 207, - SourceFile = 208, - SyntaxList = 209, - Count = 210, + OfKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ForOfStatement = 181, + ContinueStatement = 182, + BreakStatement = 183, + ReturnStatement = 184, + WithStatement = 185, + SwitchStatement = 186, + LabeledStatement = 187, + ThrowStatement = 188, + TryStatement = 189, + DebuggerStatement = 190, + VariableDeclaration = 191, + VariableDeclarationList = 192, + FunctionDeclaration = 193, + ClassDeclaration = 194, + InterfaceDeclaration = 195, + TypeAliasDeclaration = 196, + EnumDeclaration = 197, + ModuleDeclaration = 198, + ModuleBlock = 199, + ImportDeclaration = 200, + ExportAssignment = 201, + ExternalModuleReference = 202, + CaseClause = 203, + DefaultClause = 204, + HeritageClause = 205, + CatchClause = 206, + PropertyAssignment = 207, + ShorthandPropertyAssignment = 208, + EnumMember = 209, + SourceFile = 210, + SyntaxList = 211, + Count = 212, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 121, + LastKeyword = 122, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 136, - LastTypeNode = 144, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, @@ -361,7 +363,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 122, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -692,6 +694,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 36bce4fa9f5..402f8491be6 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -828,271 +828,277 @@ declare module "typescript" { TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 122, + OfKeyword = 122, +>OfKeyword : SyntaxKind + + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 123, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 124, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 125, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 126, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 127, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 128, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 129, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 130, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 131, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 132, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 133, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 134, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 135, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 136, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 137, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 138, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 139, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 140, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 141, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 142, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 143, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 144, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 145, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 146, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 147, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 148, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 149, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 150, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 151, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 152, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 153, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 154, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 155, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 156, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 157, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 158, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 159, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 160, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 161, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 162, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 163, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 164, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 165, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 166, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 167, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 168, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 169, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 170, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 171, + Block = 172, >Block : SyntaxKind - VariableStatement = 172, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 173, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 174, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 175, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 176, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 177, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 178, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 179, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 180, + ForOfStatement = 181, +>ForOfStatement : SyntaxKind + + ContinueStatement = 182, >ContinueStatement : SyntaxKind - BreakStatement = 181, + BreakStatement = 183, >BreakStatement : SyntaxKind - ReturnStatement = 182, + ReturnStatement = 184, >ReturnStatement : SyntaxKind - WithStatement = 183, + WithStatement = 185, >WithStatement : SyntaxKind - SwitchStatement = 184, + SwitchStatement = 186, >SwitchStatement : SyntaxKind - LabeledStatement = 185, + LabeledStatement = 187, >LabeledStatement : SyntaxKind - ThrowStatement = 186, + ThrowStatement = 188, >ThrowStatement : SyntaxKind - TryStatement = 187, + TryStatement = 189, >TryStatement : SyntaxKind - DebuggerStatement = 188, + DebuggerStatement = 190, >DebuggerStatement : SyntaxKind - VariableDeclaration = 189, + VariableDeclaration = 191, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 190, + VariableDeclarationList = 192, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 191, + FunctionDeclaration = 193, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 192, + ClassDeclaration = 194, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 193, + InterfaceDeclaration = 195, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 194, + TypeAliasDeclaration = 196, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 195, + EnumDeclaration = 197, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 196, + ModuleDeclaration = 198, >ModuleDeclaration : SyntaxKind - ModuleBlock = 197, + ModuleBlock = 199, >ModuleBlock : SyntaxKind - ImportDeclaration = 198, + ImportDeclaration = 200, >ImportDeclaration : SyntaxKind - ExportAssignment = 199, + ExportAssignment = 201, >ExportAssignment : SyntaxKind - ExternalModuleReference = 200, + ExternalModuleReference = 202, >ExternalModuleReference : SyntaxKind - CaseClause = 201, + CaseClause = 203, >CaseClause : SyntaxKind - DefaultClause = 202, + DefaultClause = 204, >DefaultClause : SyntaxKind - HeritageClause = 203, + HeritageClause = 205, >HeritageClause : SyntaxKind - CatchClause = 204, + CatchClause = 206, >CatchClause : SyntaxKind - PropertyAssignment = 205, + PropertyAssignment = 207, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 206, + ShorthandPropertyAssignment = 208, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 207, + EnumMember = 209, >EnumMember : SyntaxKind - SourceFile = 208, + SourceFile = 210, >SourceFile : SyntaxKind - SyntaxList = 209, + SyntaxList = 211, >SyntaxList : SyntaxKind - Count = 210, + Count = 212, >Count : SyntaxKind FirstAssignment = 52, @@ -1110,7 +1116,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 121, + LastKeyword = 122, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -1119,10 +1125,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 136, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 144, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1161,7 +1167,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 122, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2142,6 +2148,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/parserES5ForOfStatement1.d.errors.txt b/tests/baselines/reference/parserES5ForOfStatement1.d.errors.txt new file mode 100644 index 00000000000..9c1a39b1f4a --- /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 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. + } \ 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..d7f411b1879 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement10.errors.txt @@ -0,0 +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 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/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..48805a336c7 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement11.errors.txt @@ -0,0 +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 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/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..3b9f242b975 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement12.errors.txt @@ -0,0 +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 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/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..8b8c8ce0868 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement13.errors.txt @@ -0,0 +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 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/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..dc4db95270a --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement14.errors.txt @@ -0,0 +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 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/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..07aa6dd5b37 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement15.errors.txt @@ -0,0 +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 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/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..15a3e4f7f0b --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement16.errors.txt @@ -0,0 +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 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/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/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..fc314e51012 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement18.errors.txt @@ -0,0 +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 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/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..347ae29ddb8 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement2.errors.txt @@ -0,0 +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 errors) ==== + for (var of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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.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.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/parserES5ForOfStatement21.errors.txt b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt new file mode 100644 index 00000000000..2ddbf4b5666 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement21.errors.txt @@ -0,0 +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 errors) ==== + for (var of of) { } + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. \ 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/parserES5ForOfStatement3.errors.txt b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt new file mode 100644 index 00000000000..553ca40aee0 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement3.errors.txt @@ -0,0 +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 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/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..6a08c8942ed --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement4.errors.txt @@ -0,0 +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 errors) ==== + for (var a = 1 of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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..212eae8ac10 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement5.errors.txt @@ -0,0 +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 errors) ==== + for (var a: number of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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..e331b66eb85 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement6.errors.txt @@ -0,0 +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 errors) ==== + for (var a = 1, b = 2 of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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..5ba60c264eb --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement7.errors.txt @@ -0,0 +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 errors) ==== + for (var a: number = 1, b: string = "" of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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..3696bf11f8c --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement8.errors.txt @@ -0,0 +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 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/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..6e2e9d05705 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement9.errors.txt @@ -0,0 +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 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/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/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/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/parserForOfStatement1.d.errors.txt b/tests/baselines/reference/parserForOfStatement1.d.errors.txt new file mode 100644 index 00000000000..05af0a6f775 --- /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 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. + } \ 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..570c319b51f --- /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.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/parserForOfStatement11.errors.txt b/tests/baselines/reference/parserForOfStatement11.errors.txt new file mode 100644 index 00000000000..f253a2d4295 --- /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.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/parserForOfStatement12.errors.txt b/tests/baselines/reference/parserForOfStatement12.errors.txt new file mode 100644 index 00000000000..07ef4498984 --- /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.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/parserForOfStatement13.errors.txt b/tests/baselines/reference/parserForOfStatement13.errors.txt new file mode 100644 index 00000000000..6c10a7b0582 --- /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.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/parserForOfStatement14.errors.txt b/tests/baselines/reference/parserForOfStatement14.errors.txt new file mode 100644 index 00000000000..209a39c0513 --- /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.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/parserForOfStatement15.errors.txt b/tests/baselines/reference/parserForOfStatement15.errors.txt new file mode 100644 index 00000000000..c5fd77af299 --- /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.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/parserForOfStatement16.errors.txt b/tests/baselines/reference/parserForOfStatement16.errors.txt new file mode 100644 index 00000000000..d169eef1256 --- /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.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/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.errors.txt b/tests/baselines/reference/parserForOfStatement18.errors.txt new file mode 100644 index 00000000000..9312af76fc1 --- /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.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/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..8e7da497308 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement2.errors.txt @@ -0,0 +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 errors) ==== + for (var of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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.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.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/parserForOfStatement21.errors.txt b/tests/baselines/reference/parserForOfStatement21.errors.txt new file mode 100644 index 00000000000..dad48f415cd --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement21.errors.txt @@ -0,0 +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 errors) ==== + for (var of of) { } + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. \ 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/baselines/reference/parserForOfStatement3.errors.txt b/tests/baselines/reference/parserForOfStatement3.errors.txt new file mode 100644 index 00000000000..83985f1a710 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement3.errors.txt @@ -0,0 +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 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/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.errors.txt b/tests/baselines/reference/parserForOfStatement4.errors.txt new file mode 100644 index 00000000000..94dd08ed597 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement4.errors.txt @@ -0,0 +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 errors) ==== + for (var a = 1 of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ No newline at end of file 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.errors.txt b/tests/baselines/reference/parserForOfStatement5.errors.txt new file mode 100644 index 00000000000..6570f4a0755 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement5.errors.txt @@ -0,0 +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 errors) ==== + for (var a: number of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ No newline at end of file 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..6208749911f --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement6.errors.txt @@ -0,0 +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 errors) ==== + for (var a = 1, b = 2 of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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..1810daad5ee --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement7.errors.txt @@ -0,0 +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 errors) ==== + for (var a: number = 1, b: string = "" of X) { + ~~~ +!!! error TS9003: 'for...of' statements are not currently supported. + } \ 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.errors.txt b/tests/baselines/reference/parserForOfStatement8.errors.txt new file mode 100644 index 00000000000..8e2c41d0cef --- /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.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/parserForOfStatement9.errors.txt b/tests/baselines/reference/parserForOfStatement9.errors.txt new file mode 100644 index 00000000000..01fd729e9cd --- /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.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/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/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/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/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/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/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/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/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 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