From fbb2f7994d0941db86fc9453a6f36a779ec8f67b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Wed, 19 May 2021 14:19:37 -0700 Subject: [PATCH] Revert "Adding Diagnostic message for missing ']' and ')' in Array literal and conditional statements (#40884)" This reverts commit 555ef73da88a9316a5769b9329eb01f7ac0fc92b. --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/parser.ts | 47 +++++-------- ...torWithIncompleteTypeAnnotation.errors.txt | 2 - ...tructuringParameterDeclaration2.errors.txt | 1 - .../missingCloseBracketInArray.errors.txt | 8 --- .../reference/missingCloseBracketInArray.js | 5 -- .../missingCloseBracketInArray.symbols | 5 -- .../missingCloseBracketInArray.types | 11 --- .../missingCloseParenStatements.errors.txt | 32 --------- .../reference/missingCloseParenStatements.js | 28 -------- .../missingCloseParenStatements.symbols | 37 ---------- .../missingCloseParenStatements.types | 67 ------------------- ...RecoveryArrayLiteralExpression3.errors.txt | 1 - ...parserErrorRecoveryIfStatement2.errors.txt | 1 - ...parserErrorRecoveryIfStatement3.errors.txt | 1 - .../reference/reservedWords2.errors.txt | 3 - .../reference/typeAssertions.errors.txt | 2 - .../compiler/missingCloseBracketInArray.ts | 1 - .../compiler/missingCloseParenStatements.ts | 13 ---- ...serErrorRecoveryArrayLiteralExpression3.ts | 1 + 20 files changed, 17 insertions(+), 251 deletions(-) delete mode 100644 tests/baselines/reference/missingCloseBracketInArray.errors.txt delete mode 100644 tests/baselines/reference/missingCloseBracketInArray.js delete mode 100644 tests/baselines/reference/missingCloseBracketInArray.symbols delete mode 100644 tests/baselines/reference/missingCloseBracketInArray.types delete mode 100644 tests/baselines/reference/missingCloseParenStatements.errors.txt delete mode 100644 tests/baselines/reference/missingCloseParenStatements.js delete mode 100644 tests/baselines/reference/missingCloseParenStatements.symbols delete mode 100644 tests/baselines/reference/missingCloseParenStatements.types delete mode 100644 tests/cases/compiler/missingCloseBracketInArray.ts delete mode 100644 tests/cases/compiler/missingCloseParenStatements.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5c8810f5ea8ca..ba749e786683c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -15,7 +15,7 @@ "category": "Error", "code": 1006 }, - "The parser expected to find a '{1}' to match the '{0}' token here.": { + "The parser expected to find a '}' to match the '{' token here.": { "category": "Error", "code": 1007 }, diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 51a6ac64a1d92..48ee8a4c89996 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1543,20 +1543,6 @@ namespace ts { return false; } - function parseExpectedMatchingBrackets(openKind: SyntaxKind, closeKind: SyntaxKind, openPosition: number) { - if (!parseExpected(closeKind)) { - const lastError = lastOrUndefined(parseDiagnostics); - if (lastError && lastError.code === Diagnostics._0_expected.code) { - addRelatedInfo( - lastError, - createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) - ); - } - return false; - } - return true; - } - function parseOptional(t: SyntaxKind): boolean { if (token() === t) { nextToken(); @@ -5447,11 +5433,10 @@ namespace ts { function parseArrayLiteralExpression(): ArrayLiteralExpression { const pos = getNodePos(); - const openBracketPosition = scanner.getTokenPos(); parseExpected(SyntaxKind.OpenBracketToken); const multiLine = scanner.hasPrecedingLineBreak(); const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); - parseExpectedMatchingBrackets(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken, openBracketPosition); + parseExpected(SyntaxKind.CloseBracketToken); return finishNode(factory.createArrayLiteralExpression(elements, multiLine), pos); } @@ -5525,7 +5510,7 @@ namespace ts { if (lastError && lastError.code === Diagnostics._0_expected.code) { addRelatedInfo( lastError, - createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(SyntaxKind.OpenBraceToken), tokenToString(SyntaxKind.CloseBraceToken)) + createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here) ); } } @@ -5614,14 +5599,16 @@ namespace ts { if (parseExpected(SyntaxKind.OpenBraceToken, diagnosticMessage) || ignoreMissingOpenBrace) { const multiLine = scanner.hasPrecedingLineBreak(); const statements = parseList(ParsingContext.BlockStatements, parseStatement); - parseExpectedMatchingBrackets(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, openBracePosition); - const result = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc); - if (token() === SyntaxKind.EqualsToken) { - parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); - nextToken(); + if (!parseExpected(SyntaxKind.CloseBraceToken)) { + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === Diagnostics._0_expected.code) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here) + ); + } } - - return result; + return finishNode(factory.createBlock(statements, multiLine), pos); } else { const statements = createMissingList(); @@ -5670,10 +5657,9 @@ namespace ts { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); parseExpected(SyntaxKind.IfKeyword); - const openParenPosition = scanner.getTokenPos(); parseExpected(SyntaxKind.OpenParenToken); const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken, openParenPosition); + parseExpected(SyntaxKind.CloseParenToken); const thenStatement = parseStatement(); const elseStatement = parseOptional(SyntaxKind.ElseKeyword) ? parseStatement() : undefined; return withJSDoc(finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); @@ -5685,10 +5671,9 @@ namespace ts { parseExpected(SyntaxKind.DoKeyword); const statement = parseStatement(); parseExpected(SyntaxKind.WhileKeyword); - const openParenPosition = scanner.getTokenPos(); parseExpected(SyntaxKind.OpenParenToken); const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken, openParenPosition); + parseExpected(SyntaxKind.CloseParenToken); // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in @@ -5702,10 +5687,9 @@ namespace ts { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); parseExpected(SyntaxKind.WhileKeyword); - const openParenPosition = scanner.getTokenPos(); parseExpected(SyntaxKind.OpenParenToken); const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken, openParenPosition); + parseExpected(SyntaxKind.CloseParenToken); const statement = parseStatement(); return withJSDoc(finishNode(factory.createWhileStatement(expression, statement), pos), hasJSDoc); } @@ -5781,10 +5765,9 @@ namespace ts { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); parseExpected(SyntaxKind.WithKeyword); - const openParenPosition = scanner.getTokenPos(); parseExpected(SyntaxKind.OpenParenToken); const expression = allowInAnd(parseExpression); - parseExpectedMatchingBrackets(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken, openParenPosition); + parseExpected(SyntaxKind.CloseParenToken); const statement = doInsideOfContext(NodeFlags.InWithStatement, parseStatement); return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc); } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 372302f9435b5..2e3854ac84726 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -121,7 +121,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS if (retValue != 0 ^= { ~~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts:22:20: The parser expected to find a ')' to match the '(' token here. ~ @@ -505,7 +504,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1135: Argument expression expected. ~ !!! error TS1005: '(' expected. -!!! related TS1007 tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts:257:33: The parser expected to find a ')' to match the '(' token here. ~~~~~~ !!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~~~ diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt index 02dde837f351a..c1c79a2300d26 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -39,7 +39,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2322: Type 'string' is not assignable to type 'number'. ~ !!! error TS1005: ',' expected. -!!! related TS1007 tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts:7:4: The parser expected to find a ']' to match the '[' token here. a0([1, 2, [["world"]], "string"]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. diff --git a/tests/baselines/reference/missingCloseBracketInArray.errors.txt b/tests/baselines/reference/missingCloseBracketInArray.errors.txt deleted file mode 100644 index 26801c02812b4..0000000000000 --- a/tests/baselines/reference/missingCloseBracketInArray.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/missingCloseBracketInArray.ts(1,48): error TS1005: ']' expected. - - -==== tests/cases/compiler/missingCloseBracketInArray.ts (1 errors) ==== - var alphas:string[] = alphas = ["1","2","3","4" - -!!! error TS1005: ']' expected. -!!! related TS1007 tests/cases/compiler/missingCloseBracketInArray.ts:1:32: The parser expected to find a ']' to match the '[' token here. \ No newline at end of file diff --git a/tests/baselines/reference/missingCloseBracketInArray.js b/tests/baselines/reference/missingCloseBracketInArray.js deleted file mode 100644 index cb842d1cc7413..0000000000000 --- a/tests/baselines/reference/missingCloseBracketInArray.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [missingCloseBracketInArray.ts] -var alphas:string[] = alphas = ["1","2","3","4" - -//// [missingCloseBracketInArray.js] -var alphas = alphas = ["1", "2", "3", "4"]; diff --git a/tests/baselines/reference/missingCloseBracketInArray.symbols b/tests/baselines/reference/missingCloseBracketInArray.symbols deleted file mode 100644 index 4d28f8945fd13..0000000000000 --- a/tests/baselines/reference/missingCloseBracketInArray.symbols +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/compiler/missingCloseBracketInArray.ts === -var alphas:string[] = alphas = ["1","2","3","4" ->alphas : Symbol(alphas, Decl(missingCloseBracketInArray.ts, 0, 3)) ->alphas : Symbol(alphas, Decl(missingCloseBracketInArray.ts, 0, 3)) - diff --git a/tests/baselines/reference/missingCloseBracketInArray.types b/tests/baselines/reference/missingCloseBracketInArray.types deleted file mode 100644 index 557a865827c2b..0000000000000 --- a/tests/baselines/reference/missingCloseBracketInArray.types +++ /dev/null @@ -1,11 +0,0 @@ -=== tests/cases/compiler/missingCloseBracketInArray.ts === -var alphas:string[] = alphas = ["1","2","3","4" ->alphas : string[] ->alphas = ["1","2","3","4" : string[] ->alphas : string[] ->["1","2","3","4" : string[] ->"1" : "1" ->"2" : "2" ->"3" : "3" ->"4" : "4" - diff --git a/tests/baselines/reference/missingCloseParenStatements.errors.txt b/tests/baselines/reference/missingCloseParenStatements.errors.txt deleted file mode 100644 index 3f49d5a036653..0000000000000 --- a/tests/baselines/reference/missingCloseParenStatements.errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -tests/cases/compiler/missingCloseParenStatements.ts(2,26): error TS1005: ')' expected. -tests/cases/compiler/missingCloseParenStatements.ts(4,5): error TS1005: ')' expected. -tests/cases/compiler/missingCloseParenStatements.ts(8,39): error TS1005: ')' expected. -tests/cases/compiler/missingCloseParenStatements.ts(11,35): error TS1005: ')' expected. - - -==== tests/cases/compiler/missingCloseParenStatements.ts (4 errors) ==== - var a1, a2, a3 = 0; - if ( a1 && (a2 + a3 > 0) { - ~ -!!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/missingCloseParenStatements.ts:2:4: The parser expected to find a ')' to match the '(' token here. - while( (a2 > 0) && a1 - { - ~ -!!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/missingCloseParenStatements.ts:3:10: The parser expected to find a ')' to match the '(' token here. - do { - var i = i + 1; - a1 = a1 + i; - with ((a2 + a3 > 0) && a1 { - ~ -!!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/missingCloseParenStatements.ts:8:18: The parser expected to find a ')' to match the '(' token here. - console.log(x); - } - } while (i < 5 && (a1 > 5); - ~ -!!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/missingCloseParenStatements.ts:11:17: The parser expected to find a ')' to match the '(' token here. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/missingCloseParenStatements.js b/tests/baselines/reference/missingCloseParenStatements.js deleted file mode 100644 index 8ba56b6b88183..0000000000000 --- a/tests/baselines/reference/missingCloseParenStatements.js +++ /dev/null @@ -1,28 +0,0 @@ -//// [missingCloseParenStatements.ts] -var a1, a2, a3 = 0; -if ( a1 && (a2 + a3 > 0) { - while( (a2 > 0) && a1 - { - do { - var i = i + 1; - a1 = a1 + i; - with ((a2 + a3 > 0) && a1 { - console.log(x); - } - } while (i < 5 && (a1 > 5); - } -} - -//// [missingCloseParenStatements.js] -var a1, a2, a3 = 0; -if (a1 && (a2 + a3 > 0)) { - while ((a2 > 0) && a1) { - do { - var i = i + 1; - a1 = a1 + i; - with ((a2 + a3 > 0) && a1) { - console.log(x); - } - } while (i < 5 && (a1 > 5)); - } -} diff --git a/tests/baselines/reference/missingCloseParenStatements.symbols b/tests/baselines/reference/missingCloseParenStatements.symbols deleted file mode 100644 index e403570f8e832..0000000000000 --- a/tests/baselines/reference/missingCloseParenStatements.symbols +++ /dev/null @@ -1,37 +0,0 @@ -=== tests/cases/compiler/missingCloseParenStatements.ts === -var a1, a2, a3 = 0; ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) ->a2 : Symbol(a2, Decl(missingCloseParenStatements.ts, 0, 7)) ->a3 : Symbol(a3, Decl(missingCloseParenStatements.ts, 0, 11)) - -if ( a1 && (a2 + a3 > 0) { ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) ->a2 : Symbol(a2, Decl(missingCloseParenStatements.ts, 0, 7)) ->a3 : Symbol(a3, Decl(missingCloseParenStatements.ts, 0, 11)) - - while( (a2 > 0) && a1 ->a2 : Symbol(a2, Decl(missingCloseParenStatements.ts, 0, 7)) ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) - { - do { - var i = i + 1; ->i : Symbol(i, Decl(missingCloseParenStatements.ts, 5, 15)) ->i : Symbol(i, Decl(missingCloseParenStatements.ts, 5, 15)) - - a1 = a1 + i; ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) ->i : Symbol(i, Decl(missingCloseParenStatements.ts, 5, 15)) - - with ((a2 + a3 > 0) && a1 { ->a2 : Symbol(a2, Decl(missingCloseParenStatements.ts, 0, 7)) ->a3 : Symbol(a3, Decl(missingCloseParenStatements.ts, 0, 11)) ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) - - console.log(x); - } - } while (i < 5 && (a1 > 5); ->i : Symbol(i, Decl(missingCloseParenStatements.ts, 5, 15)) ->a1 : Symbol(a1, Decl(missingCloseParenStatements.ts, 0, 3)) - } -} diff --git a/tests/baselines/reference/missingCloseParenStatements.types b/tests/baselines/reference/missingCloseParenStatements.types deleted file mode 100644 index 0d1b7469f6073..0000000000000 --- a/tests/baselines/reference/missingCloseParenStatements.types +++ /dev/null @@ -1,67 +0,0 @@ -=== tests/cases/compiler/missingCloseParenStatements.ts === -var a1, a2, a3 = 0; ->a1 : any ->a2 : any ->a3 : number ->0 : 0 - -if ( a1 && (a2 + a3 > 0) { ->a1 && (a2 + a3 > 0) : boolean ->a1 : any ->(a2 + a3 > 0) : boolean ->a2 + a3 > 0 : boolean ->a2 + a3 : any ->a2 : any ->a3 : number ->0 : 0 - - while( (a2 > 0) && a1 ->(a2 > 0) && a1 : any ->(a2 > 0) : boolean ->a2 > 0 : boolean ->a2 : any ->0 : 0 ->a1 : any - { - do { - var i = i + 1; ->i : any ->i + 1 : any ->i : any ->1 : 1 - - a1 = a1 + i; ->a1 = a1 + i : any ->a1 : any ->a1 + i : any ->a1 : any ->i : any - - with ((a2 + a3 > 0) && a1 { ->(a2 + a3 > 0) && a1 : any ->(a2 + a3 > 0) : boolean ->a2 + a3 > 0 : boolean ->a2 + a3 : any ->a2 : any ->a3 : number ->0 : 0 ->a1 : any - - console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any ->x : any - } - } while (i < 5 && (a1 > 5); ->i < 5 && (a1 > 5) : boolean ->i < 5 : boolean ->i : any ->5 : 5 ->(a1 > 5) : boolean ->a1 > 5 : boolean ->a1 : any ->5 : 5 - } -} diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt index 9de5aa8014cfb..eb32618af4bbf 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt @@ -8,7 +8,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552]; ~ !!! error TS1005: ',' expected. -!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts:1:17: The parser expected to find a ']' to match the '[' token here. ~~~~~~~~~ !!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement2.errors.txt b/tests/baselines/reference/parserErrorRecoveryIfStatement2.errors.txt index b88c48182a27b..45dd9935a6229 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement2.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement2.errors.txt @@ -11,7 +11,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IfStatements/parserErro } ~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IfStatements/parserErrorRecoveryIfStatement2.ts:3:8: The parser expected to find a ')' to match the '(' token here. f2() { } f3() { diff --git a/tests/baselines/reference/parserErrorRecoveryIfStatement3.errors.txt b/tests/baselines/reference/parserErrorRecoveryIfStatement3.errors.txt index cfd645e592542..631cdb08a90e4 100644 --- a/tests/baselines/reference/parserErrorRecoveryIfStatement3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryIfStatement3.errors.txt @@ -11,7 +11,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IfStatements/parserErro } ~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IfStatements/parserErrorRecoveryIfStatement3.ts:3:8: The parser expected to find a ')' to match the '(' token here. f2() { } f3() { diff --git a/tests/baselines/reference/reservedWords2.errors.txt b/tests/baselines/reference/reservedWords2.errors.txt index 7c078493e8d9d..599010b436872 100644 --- a/tests/baselines/reference/reservedWords2.errors.txt +++ b/tests/baselines/reference/reservedWords2.errors.txt @@ -45,7 +45,6 @@ tests/cases/compiler/reservedWords2.ts(12,17): error TS1138: Parameter declarati !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/reservedWords2.ts:1:14: The parser expected to find a ')' to match the '(' token here. import * as while from "foo" !!! error TS2300: Duplicate identifier '(Missing)'. @@ -59,7 +58,6 @@ tests/cases/compiler/reservedWords2.ts(12,17): error TS1138: Parameter declarati !!! error TS2304: Cannot find name 'from'. ~~~~~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/compiler/reservedWords2.ts:2:20: The parser expected to find a ')' to match the '(' token here. var typeof = 10; ~~~~~~ @@ -105,7 +103,6 @@ tests/cases/compiler/reservedWords2.ts(12,17): error TS1138: Parameter declarati !!! error TS1005: ';' expected. ~ !!! error TS1005: '(' expected. -!!! related TS1007 tests/cases/compiler/reservedWords2.ts:9:18: The parser expected to find a ')' to match the '(' token here. ~ !!! error TS1128: Declaration or statement expected. enum void {} diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index cf132a12d0262..9d10ec17fe95d 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -93,7 +93,6 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err !!! error TS2304: Cannot find name 'is'. ~~~~~~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts:44:3: The parser expected to find a ')' to match the '(' token here. ~~~~~~ !!! error TS2693: 'string' only refers to a type, but is being used as a value here. ~ @@ -109,7 +108,6 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err !!! error TS2749: 'numOrStr' refers to a value, but is being used as a type here. Did you mean 'typeof numOrStr'? ~~ !!! error TS1005: ')' expected. -!!! related TS1007 tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts:48:3: The parser expected to find a ')' to match the '(' token here. ~~ !!! error TS2304: Cannot find name 'is'. ~~~~~~ diff --git a/tests/cases/compiler/missingCloseBracketInArray.ts b/tests/cases/compiler/missingCloseBracketInArray.ts deleted file mode 100644 index cb99f0d227757..0000000000000 --- a/tests/cases/compiler/missingCloseBracketInArray.ts +++ /dev/null @@ -1 +0,0 @@ -var alphas:string[] = alphas = ["1","2","3","4" \ No newline at end of file diff --git a/tests/cases/compiler/missingCloseParenStatements.ts b/tests/cases/compiler/missingCloseParenStatements.ts deleted file mode 100644 index 7ff34bdae6a16..0000000000000 --- a/tests/cases/compiler/missingCloseParenStatements.ts +++ /dev/null @@ -1,13 +0,0 @@ -var a1, a2, a3 = 0; -if ( a1 && (a2 + a3 > 0) { - while( (a2 > 0) && a1 - { - do { - var i = i + 1; - a1 = a1 + i; - with ((a2 + a3 > 0) && a1 { - console.log(x); - } - } while (i < 5 && (a1 > 5); - } -} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts index 18ed3b5ef5a50..58df0691d8e2c 100644 --- a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts +++ b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts @@ -1 +1,2 @@ + var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552];