mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Adding new tests
This commit is contained in:
parent
b416cbc599
commit
3e436c5047
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
10
tests/baselines/reference/restElementWithInitializer2.js
Normal file
10
tests/baselines/reference/restElementWithInitializer2.js
Normal 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
|
||||
@ -0,0 +1,2 @@
|
||||
var a: number[];
|
||||
var [...x = a] = a; // Error, rest element cannot have initializer
|
||||
@ -0,0 +1,3 @@
|
||||
var a: number[];
|
||||
var x: number[];
|
||||
[...x = a] = a; // Error, rest element cannot have initializer
|
||||
Loading…
x
Reference in New Issue
Block a user