From c1d509a940b72eab9866505c72890eb8657f5cc6 Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 8 Dec 2014 15:38:35 -0800 Subject: [PATCH] Update and add test cases --- .../MemberFunctionDeclaration8_es6.errors.txt | 27 +++----- ...torWithIncompleteTypeAnnotation.errors.txt | 63 ++++++++----------- ...arseIncompleteBinaryExpression1.errors.txt | 10 +++ .../parserAmbiguityWithBinaryOperator1.js | 12 ++++ .../parserAmbiguityWithBinaryOperator1.types | 20 ++++++ .../parserAmbiguityWithBinaryOperator2.js | 12 ++++ .../parserAmbiguityWithBinaryOperator2.types | 20 ++++++ .../parserAmbiguityWithBinaryOperator3.js | 13 ++++ .../parserAmbiguityWithBinaryOperator3.types | 21 +++++++ ...serAmbiguityWithBinaryOperator4.errors.txt | 10 +++ .../parserAmbiguityWithBinaryOperator4.js | 12 ++++ .../parserCommaInTypeMemberList2.errors.txt | 4 +- .../parserErrorRecovery_Block2.errors.txt | 8 +-- ...rserErrorRecovery_ClassElement3.errors.txt | 23 ++++--- ...serErrorRecovery_ParameterList4.errors.txt | 8 +-- .../Blocks/parserErrorRecovery_Block2.ts | 2 +- .../parserErrorRecovery_ClassElement3.ts | 6 +- .../parserErrorRecovery_ParameterList4.ts | 2 +- .../parseIncompleteBinaryExpression1.ts | 1 + .../parserAmbiguityWithBinaryOperator1.ts | 4 ++ .../parserAmbiguityWithBinaryOperator2.ts | 4 ++ .../parserAmbiguityWithBinaryOperator3.ts | 4 ++ .../parserAmbiguityWithBinaryOperator4.ts | 4 ++ 23 files changed, 211 insertions(+), 79 deletions(-) create mode 100644 tests/baselines/reference/parseIncompleteBinaryExpression1.errors.txt create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator4.errors.txt create mode 100644 tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js create mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts diff --git a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt index 1b216b72c89..a946c17ff71 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt @@ -1,14 +1,11 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,12): error TS1127: Invalid character. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1129: Statement expected. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,19): error TS1005: '(' expected. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(6,3): error TS1128: Declaration or statement expected. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(7,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1109: Expression expected. tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'. -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2304: Cannot find name 'bar'. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,12): error TS2304: Cannot find name 'bar'. -==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (8 errors) ==== +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (5 errors) ==== class C { foo() { // Make sure we don't think of *bar as the start of a generator method. @@ -16,19 +13,13 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration !!! error TS1127: Invalid character. ~ -!!! error TS1129: Statement expected. - ~ -!!! error TS1005: '(' expected. +!!! error TS1109: Expression expected. ~ !!! error TS2304: Cannot find name 'a'. ~~~ -!!! error TS2391: Function implementation is missing or not immediately following the declaration. +!!! error TS2304: Cannot find name 'bar'. return bar; - ~~~~~~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~~~ +!!! error TS2304: Cannot find name 'bar'. } - ~ -!!! error TS1128: Declaration or statement expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 8d544ff1bcb..ed7843ad45e 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -3,15 +3,13 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1129: Statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,33): error TS1138: Parameter declaration expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,36): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. @@ -43,21 +41,19 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1129: Statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,17): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2304: Cannot find name 'retValue'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,17): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. @@ -82,12 +78,13 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (84 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -136,30 +133,24 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { ~~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1138: Parameter declaration expected. - ~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~~ -!!! error TS2391: Function implementation is missing or not immediately following the declaration. +!!! error TS1005: '=' expected. return 1; ^ ~ -!!! error TS1129: Statement expected. +!!! error TS1109: Expression expected. retValue = bfs.TYPES(); + ~ +!!! error TS1005: ';' expected. ~~~~~~~~ -!!! error TS2304: Cannot find name 'retValue'. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~ !!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { - ~~~~~~~~ -!!! error TS2304: Cannot find name 'retValue'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. return 1 && } @@ -171,25 +162,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS1005: ';' expected. !!! error TS1002: Unterminated string literal. - ~~~~~~~~ -!!! error TS2304: Cannot find name 'retValue'. ~~~ !!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { - ~~~~~~~~ -!!! error TS2304: Cannot find name 'retValue'. + ~~~~~~~~~~~~~ +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. return 1; } } catch (e) { - ~~~~~ -!!! error TS1005: 'try' expected. console.log(e); ~~~~~~~ !!! error TS2304: Cannot find name 'console'. } finally { + ~~~~~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. } @@ -501,7 +490,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~ !!! error TS1005: ';' expected. ~ -!!! error TS1129: Statement expected. +!!! error TS1109: Expression expected. ~~~~~~~~~ !!! error TS2304: Cannot find name 'Overloads'. ~~~~~~ @@ -510,12 +499,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'string'. public DefaultValue(value?: string = "Hello") { } - ~~~~~~ -!!! error TS1129: Statement expected. + ~~~~~~~~~~~~ +!!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. ~ !!! error TS1005: ';' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. ~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'DefaultValue'. ~~~~~ diff --git a/tests/baselines/reference/parseIncompleteBinaryExpression1.errors.txt b/tests/baselines/reference/parseIncompleteBinaryExpression1.errors.txt new file mode 100644 index 00000000000..e0155acc3f1 --- /dev/null +++ b/tests/baselines/reference/parseIncompleteBinaryExpression1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts(1,9): error TS1109: Expression expected. +tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts(1,12): error TS2304: Cannot find name 'b'. + + +==== tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts (2 errors) ==== + var v = || b; + ~~ +!!! error TS1109: Expression expected. + ~ +!!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js new file mode 100644 index 00000000000..18a1dee3e9f --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.js @@ -0,0 +1,12 @@ +//// [parserAmbiguityWithBinaryOperator1.ts] +function f1() { + var a, b, c; + if (a < b || b > (c + 1)) { } +} + +//// [parserAmbiguityWithBinaryOperator1.js] +function f1() { + var a, b, c; + if (a < b || b > (c + 1)) { + } +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types new file mode 100644 index 00000000000..1a087485e26 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts === +function f1() { +>f1 : () => void + + var a, b, c; +>a : any +>b : any +>c : any + + if (a < b || b > (c + 1)) { } +>a < b || b > (c + 1) : boolean +>a < b : boolean +>a : any +>b : any +>b > (c + 1) : boolean +>b : any +>(c + 1) : any +>c + 1 : any +>c : any +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js new file mode 100644 index 00000000000..9589d57e3af --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.js @@ -0,0 +1,12 @@ +//// [parserAmbiguityWithBinaryOperator2.ts] +function f() { + var a, b, c; + if (a < b && b > (c + 1)) { } +} + +//// [parserAmbiguityWithBinaryOperator2.js] +function f() { + var a, b, c; + if (a < b && b > (c + 1)) { + } +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types new file mode 100644 index 00000000000..05ac7172cff --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts === +function f() { +>f : () => void + + var a, b, c; +>a : any +>b : any +>c : any + + if (a < b && b > (c + 1)) { } +>a < b && b > (c + 1) : boolean +>a < b : boolean +>a : any +>b : any +>b > (c + 1) : boolean +>b : any +>(c + 1) : any +>c + 1 : any +>c : any +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js new file mode 100644 index 00000000000..95745263c71 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.js @@ -0,0 +1,13 @@ +//// [parserAmbiguityWithBinaryOperator3.ts] +function f() { + var a, b, c; + if (a < b && b < (c + 1)) { } +} + + +//// [parserAmbiguityWithBinaryOperator3.js] +function f() { + var a, b, c; + if (a < b && b < (c + 1)) { + } +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types new file mode 100644 index 00000000000..03283115bf9 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types @@ -0,0 +1,21 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts === +function f() { +>f : () => void + + var a, b, c; +>a : any +>b : any +>c : any + + if (a < b && b < (c + 1)) { } +>a < b && b < (c + 1) : boolean +>a < b : boolean +>a : any +>b : any +>b < (c + 1) : boolean +>b : any +>(c + 1) : any +>c + 1 : any +>c : any +} + diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.errors.txt b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.errors.txt new file mode 100644 index 00000000000..2c7bef61598 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts(3,9): error TS2347: Untyped function calls may not accept type arguments. + + +==== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts (1 errors) ==== + function g() { + var a, b, c; + if (a(c + 1)) { } + ~~~~~~~~~~~~~~ +!!! error TS2347: Untyped function calls may not accept type arguments. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js new file mode 100644 index 00000000000..cdcec030ae7 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator4.js @@ -0,0 +1,12 @@ +//// [parserAmbiguityWithBinaryOperator4.ts] +function g() { + var a, b, c; + if (a(c + 1)) { } +} + +//// [parserAmbiguityWithBinaryOperator4.js] +function g() { + var a, b, c; + if (a(c + 1)) { + } +} diff --git a/tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt b/tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt index 025febbc9a5..bc6f3dc0644 100644 --- a/tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt +++ b/tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,38): error TS1134: Variable declaration expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,60): error TS1005: ';' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,70): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,70): error TS1109: Expression expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,9): error TS2304: Cannot find name '$'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,31): error TS2304: Cannot find name 'any'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList2.ts(1,50): error TS2304: Cannot find name 'any'. @@ -15,7 +15,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMember ~ !!! error TS1005: ';' expected. ~ -!!! error TS1128: Declaration or statement expected. +!!! error TS1109: Expression expected. ~ !!! error TS2304: Cannot find name '$'. ~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_Block2.errors.txt b/tests/baselines/reference/parserErrorRecovery_Block2.errors.txt index bce96874f4c..53279be443f 100644 --- a/tests/baselines/reference/parserErrorRecovery_Block2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_Block2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts(2,5): error TS1129: Statement expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts(2,5): error TS1127: Invalid character. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts (1 errors) ==== function f() { - | - ~ -!!! error TS1129: Statement expected. + # + +!!! error TS1127: Invalid character. return; } \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt b/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt index e2856855824..63c62bcd13d 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt @@ -1,19 +1,22 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(2,4): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(5,4): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(2,4): error TS1127: Invalid character. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(5,4): error TS1127: Invalid character. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(7,4): error TS1127: Invalid character. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts(7,5): error TS1005: '}' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts (4 errors) ==== module M { - | - ~ -!!! error TS1128: Declaration or statement expected. + # + +!!! error TS1127: Invalid character. class C { } - | - ~ -!!! error TS1128: Declaration or statement expected. + @ + +!!! error TS1127: Invalid character. enum E { - } + # + +!!! error TS1127: Invalid character. !!! error TS1005: '}' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ParameterList4.errors.txt b/tests/baselines/reference/parserErrorRecovery_ParameterList4.errors.txt index d44f6eadcf2..fa97550dd19 100644 --- a/tests/baselines/reference/parserErrorRecovery_ParameterList4.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ParameterList4.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts(1,14): error TS1138: Parameter declaration expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts(1,14): error TS1127: Invalid character. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts (1 errors) ==== - function f(a,|) { - ~ -!!! error TS1138: Parameter declaration expected. + function f(a,#) { + +!!! error TS1127: Invalid character. } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts index a28fa48ec87..2473a9d1ffb 100644 --- a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts +++ b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block2.ts @@ -1,4 +1,4 @@ function f() { - | + # return; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts index c6e2649f1b2..d4ea9d60787 100644 --- a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts +++ b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ClassElements/parserErrorRecovery_ClassElement3.ts @@ -1,7 +1,7 @@ module M { - | + # class C { } - | + @ enum E { - } \ No newline at end of file + # \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts index 62b39e7f3cc..f46e4695145 100644 --- a/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts +++ b/tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList4.ts @@ -1,2 +1,2 @@ -function f(a,|) { +function f(a,#) { } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts b/tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts new file mode 100644 index 00000000000..f5a3bb0e701 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Expressions/parseIncompleteBinaryExpression1.ts @@ -0,0 +1 @@ +var v = || b; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts new file mode 100644 index 00000000000..d008e7f7abc --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts @@ -0,0 +1,4 @@ +function f1() { + var a, b, c; + if (a < b || b > (c + 1)) { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts new file mode 100644 index 00000000000..ed2fb80fef0 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts @@ -0,0 +1,4 @@ +function f() { + var a, b, c; + if (a < b && b > (c + 1)) { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts new file mode 100644 index 00000000000..25bc7e0c95d --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts @@ -0,0 +1,4 @@ +function f() { + var a, b, c; + if (a < b && b < (c + 1)) { } +} diff --git a/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts new file mode 100644 index 00000000000..22fc2f8e182 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts @@ -0,0 +1,4 @@ +function g() { + var a, b, c; + if (a(c + 1)) { } +} \ No newline at end of file