File: destructuringParameterDeclaration6.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (63 lines) | stat: -rw-r--r-- 3,541 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(7,18): error TS1005: ':' expected.
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 TS2695: Left side of comma operator is unused and has no side effects.
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 TS2695: Left side of comma operator is unused and has no side effects.
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 TS1359: Identifier expected. 'while' is a reserved word that cannot be used here.
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.


==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (13 errors) ====
    // 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
    "use strict"
    
    // Error
    function a({while}) { }
                     ~
!!! error TS1005: ':' expected.
    function a1({public}) { }
    function a4([while, for, public]){ }
                 ~~~~~
!!! error TS1181: Array element destructuring pattern expected.
                      
!!! error TS2695: Left side of comma operator is unused and has no side effects.
                      ~
!!! error TS1005: '(' expected.
                        ~~~
!!! error TS1109: Expression expected.
                           
!!! error TS2695: Left side of comma operator is unused and has no side effects.
                           ~
!!! error TS1005: '(' expected.
                             ~~~~~~
!!! error TS2304: Cannot find name 'public'.
                                   ~
!!! error TS1005: ';' expected.
                                    ~
!!! error TS1128: Declaration or statement expected.
    function a5(...while) { }
                   ~~~~~
!!! error TS1359: Identifier expected. 'while' is a reserved word that cannot be used here.
                        ~
!!! error TS1005: '(' expected.
    function a6(...public) { }
    function a7(...a: string) { }
                ~~~~~~~~~~~~
!!! error TS2370: A rest parameter must be of an array type.
    a({ while: 1 });
    
    // No Error
    function b1({public: x}) { }
    function b2({while: y}) { }
    b1({ public: 1 });
    b2({ while: 1 });