2015-04-16 23:53:19 +02:00
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,14): error TS1181: Array element destructuring pattern expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS1005: '(' expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,21): error TS1109: Expression expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS1005: '(' expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,26): error TS2304: Cannot find name 'public'.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,32): error TS1005: ';' expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,33): error TS1128: Declaration or statement expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(10,16): error TS1003: Identifier expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(10,21): error TS1005: '(' expected.
|
|
|
|
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(12,13): error TS2370: A rest parameter must be of an array type.
|
2015-04-13 01:03:16 +02:00
|
|
|
|
|
|
|
|
2015-04-16 23:53:19 +02:00
|
|
|
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (10 errors) ====
|
2015-04-16 19:21:49 +02:00
|
|
|
// A parameter declaration may specify either an identifier or a binding pattern.
|
|
|
|
|
|
|
|
// Reserved words are not allowed to be used as an identifier in parameter declaration
|
2015-04-13 01:03:16 +02:00
|
|
|
"use strict"
|
2015-04-16 19:21:49 +02:00
|
|
|
|
|
|
|
// Error
|
2015-04-13 01:03:16 +02:00
|
|
|
function a({while}) { }
|
|
|
|
function a1({public}) { }
|
|
|
|
function a4([while, for, public]){ }
|
|
|
|
~~~~~
|
|
|
|
!!! error TS1181: Array element destructuring pattern expected.
|
|
|
|
~
|
|
|
|
!!! error TS1005: '(' expected.
|
|
|
|
~~~
|
|
|
|
!!! error TS1109: Expression expected.
|
|
|
|
~
|
|
|
|
!!! error TS1005: '(' expected.
|
|
|
|
~~~~~~
|
|
|
|
!!! error TS2304: Cannot find name 'public'.
|
|
|
|
~
|
|
|
|
!!! error TS1005: ';' expected.
|
|
|
|
~
|
|
|
|
!!! error TS1128: Declaration or statement expected.
|
|
|
|
function a5(...while) { }
|
|
|
|
~~~~~
|
|
|
|
!!! error TS1003: Identifier expected.
|
|
|
|
~
|
|
|
|
!!! error TS1005: '(' expected.
|
|
|
|
function a6(...public) { }
|
|
|
|
function a7(...a: string) { }
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
!!! error TS2370: A rest parameter must be of an array type.
|
|
|
|
a({ while: 1 });
|
|
|
|
|
2015-04-16 19:21:49 +02:00
|
|
|
// No Error
|
|
|
|
function b1({public: x}) { }
|
|
|
|
function b2({while: y}) { }
|
|
|
|
b1({ public: 1 });
|
|
|
|
b2({ while: 1 });
|
|
|
|
|
2015-04-13 01:03:16 +02:00
|
|
|
|