File: classStaticBlock6.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (111 lines) | stat: -rw-r--r-- 5,824 bytes parent folder | download | duplicates (3)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(8,13): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(9,13): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(13,9): error TS18037: Await expression cannot be used inside a class static block.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(13,14): error TS1109: Expression expected.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(17,9): error TS2662: Cannot find name 'arguments'. Did you mean the static member 'C.arguments'?
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(18,9): error TS18037: Await expression cannot be used inside a class static block.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(18,14): error TS1109: Expression expected.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(19,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(32,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(41,13): error TS2815: 'arguments' cannot be referenced in property initializers.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(42,13): error TS18037: Await expression cannot be used inside a class static block.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(42,18): error TS1109: Expression expected.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(45,17): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(46,22): error TS1109: Expression expected.
tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts(55,13): error TS2815: 'arguments' cannot be referenced in property initializers.


==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock6.ts (15 errors) ====
    class B {
        static a = 1;
    }
    
    class C extends B {
        static {
            let await = 1;
            let arguments = 1;
                ~~~~~~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
            let eval = 1;
                ~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
        }
    
        static {
            await: if (true) {
            ~~~~~
!!! error TS18037: Await expression cannot be used inside a class static block.
                 ~
!!! error TS1109: Expression expected.
    
            }
    
            arguments;
            ~~~~~~~~~
!!! error TS2662: Cannot find name 'arguments'. Did you mean the static member 'C.arguments'?
            await;
            ~~~~~
!!! error TS18037: Await expression cannot be used inside a class static block.
                 ~
!!! error TS1109: Expression expected.
            super();
            ~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
        }
    }
    
    class CC {
        constructor () {
            class C extends B {
                static {
                    class CC extends B {
                        constructor () {
                            super();
                        }
                    }
                    super();
                    ~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
                }
            }
        }
    }
    
    async function foo () {
        class C extends B {
            static {
                arguments;
                ~~~~~~~~~
!!! error TS2815: 'arguments' cannot be referenced in property initializers.
                await;
                ~~~~~
!!! error TS18037: Await expression cannot be used inside a class static block.
                     ~
!!! error TS1109: Expression expected.
    
                async function ff () {
                    arguments;
                    ~~~~~~~~~
!!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
                    await;
                         ~
!!! error TS1109: Expression expected.
                }
            }
        }
    }
    
    function foo1 () {
        class C extends B {
            static {
                arguments;
                ~~~~~~~~~
!!! error TS2815: 'arguments' cannot be referenced in property initializers.
    
                function ff () {
                    arguments;
                }
            }
        }
    }