File: superCallInStaticMethod.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (55 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download | duplicates (6)
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
tests/cases/compiler/superCallInStaticMethod.ts(30,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/superCallInStaticMethod.ts(37,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.


==== tests/cases/compiler/superCallInStaticMethod.ts (2 errors) ====
    class Doing {
        public static staticMethod() {
        }
    }
    
    class Other extends Doing {
        // in static method
        public static staticMethod() {
            super.staticMethod();
        }
    
        // in a lambda inside a static method
        public static lambdaInsideAStaticMethod() {
            () => {
                super.staticMethod();
            }
        }
    
        // in an object literal inside a static method
        public static objectLiteralInsideAStaticMethod() {
            return {
                a: () => {
                    super.staticMethod();
                },
                b: super.staticMethod()
            };
        }
    
        // in a getter
        public static get staticGetter() {
                          ~~~~~~~~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            super.staticMethod();
    
            return 0;
        }
    
        // in a setter
        public static set staticGetter(value: number) {
                          ~~~~~~~~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            super.staticMethod();
        }
    
        // in static method
        public static initializerInAStaticMethod(a = super.staticMethod()) {
            super.staticMethod();
        }
    }