Adding new tests

This commit is contained in:
Anders Hejlsberg 2014-12-12 14:34:12 -08:00
parent b416cbc599
commit 3e436c5047
5 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,9 @@
tests/cases/conformance/es6/destructuring/restElementWithInitializer1.ts(2,11): error TS1185: A rest element cannot have an initializer.
==== tests/cases/conformance/es6/destructuring/restElementWithInitializer1.ts (1 errors) ====
var a: number[];
var [...x = a] = a; // Error, rest element cannot have initializer
~
!!! error TS1185: A rest element cannot have an initializer.

View File

@ -0,0 +1,10 @@
tests/cases/conformance/es6/destructuring/restElementWithInitializer2.ts(3,5): error TS2364: Invalid left-hand side of assignment expression.
==== tests/cases/conformance/es6/destructuring/restElementWithInitializer2.ts (1 errors) ====
var a: number[];
var x: number[];
[...x = a] = a; // Error, rest element cannot have initializer
~~~~~
!!! error TS2364: Invalid left-hand side of assignment expression.

View File

@ -0,0 +1,10 @@
//// [restElementWithInitializer2.ts]
var a: number[];
var x: number[];
[...x = a] = a; // Error, rest element cannot have initializer
//// [restElementWithInitializer2.js]
var a;
var x;
x = a = a.slice(0); // Error, rest element cannot have initializer

View File

@ -0,0 +1,2 @@
var a: number[];
var [...x = a] = a; // Error, rest element cannot have initializer

View File

@ -0,0 +1,3 @@
var a: number[];
var x: number[];
[...x = a] = a; // Error, rest element cannot have initializer