diff --git a/tests/baselines/reference/VariableDeclaration12_es6.js b/tests/baselines/reference/VariableDeclaration12_es6.js new file mode 100644 index 00000000000..1e7d6d4b363 --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration12_es6.js @@ -0,0 +1,7 @@ +//// [VariableDeclaration12_es6.ts] + +let +x + +//// [VariableDeclaration12_es6.js] +let x; diff --git a/tests/baselines/reference/VariableDeclaration12_es6.symbols b/tests/baselines/reference/VariableDeclaration12_es6.symbols new file mode 100644 index 00000000000..a2f324502dd --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration12_es6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts === + +let +x +>x : Symbol(x, Decl(VariableDeclaration12_es6.ts, 1, 3)) + diff --git a/tests/baselines/reference/VariableDeclaration12_es6.types b/tests/baselines/reference/VariableDeclaration12_es6.types new file mode 100644 index 00000000000..14f23f88a7a --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration12_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts === + +let +x +>x : any + diff --git a/tests/baselines/reference/VariableDeclaration13_es6.errors.txt b/tests/baselines/reference/VariableDeclaration13_es6.errors.txt new file mode 100644 index 00000000000..a022a4ad52b --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration13_es6.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,5): error TS1181: Array element destructuring pattern expected. +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,6): error TS1005: ',' expected. +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,8): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,10): error TS1134: Variable declaration expected. + + +==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts (4 errors) ==== + + // An ExpressionStatement cannot start with the two token sequence `let [` because + // that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern. + var let: any; + let[0] = 100; + ~ +!!! error TS1181: Array element destructuring pattern expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~~~ +!!! error TS1134: Variable declaration expected. \ No newline at end of file diff --git a/tests/baselines/reference/VariableDeclaration13_es6.js b/tests/baselines/reference/VariableDeclaration13_es6.js new file mode 100644 index 00000000000..4ec04b18c3a --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration13_es6.js @@ -0,0 +1,13 @@ +//// [VariableDeclaration13_es6.ts] + +// An ExpressionStatement cannot start with the two token sequence `let [` because +// that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern. +var let: any; +let[0] = 100; + +//// [VariableDeclaration13_es6.js] +// An ExpressionStatement cannot start with the two token sequence `let [` because +// that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern. +var let; +let [] = 0; +100; diff --git a/tests/baselines/reference/letIdentifierInElementAccess01.js b/tests/baselines/reference/letIdentifierInElementAccess01.js new file mode 100644 index 00000000000..5e5e857479c --- /dev/null +++ b/tests/baselines/reference/letIdentifierInElementAccess01.js @@ -0,0 +1,7 @@ +//// [letIdentifierInElementAccess01.ts] +var let: any = {}; +(let[0] = 100); + +//// [letIdentifierInElementAccess01.js] +var let = {}; +(let[0] = 100); diff --git a/tests/baselines/reference/letIdentifierInElementAccess01.symbols b/tests/baselines/reference/letIdentifierInElementAccess01.symbols new file mode 100644 index 00000000000..a655b5703b0 --- /dev/null +++ b/tests/baselines/reference/letIdentifierInElementAccess01.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts === +var let: any = {}; +>let : Symbol(let, Decl(letIdentifierInElementAccess01.ts, 0, 3)) + +(let[0] = 100); +>let : Symbol(let, Decl(letIdentifierInElementAccess01.ts, 0, 3)) + diff --git a/tests/baselines/reference/letIdentifierInElementAccess01.types b/tests/baselines/reference/letIdentifierInElementAccess01.types new file mode 100644 index 00000000000..187fd7e221c --- /dev/null +++ b/tests/baselines/reference/letIdentifierInElementAccess01.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts === +var let: any = {}; +>let : any +>{} : {} + +(let[0] = 100); +>(let[0] = 100) : number +>let[0] = 100 : number +>let[0] : any +>let : any +>0 : number +>100 : number +