File: superCallInNonStaticMethod.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 (59 lines) | stat: -rw-r--r-- 1,850 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
56
57
58
59
tests/cases/compiler/superCallInNonStaticMethod.ts(30,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/superCallInNonStaticMethod.ts(37,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.


==== tests/cases/compiler/superCallInNonStaticMethod.ts (2 errors) ====
    class Doing {
        public instanceMethod() {
        }
    }
    
    class Other extends Doing {
        // in instance method
        public instanceMethod() {
            super.instanceMethod();
        }
    
        // in a lambda inside a instance method
        public lambdaInsideAnInstanceMethod() {
            () => {
                super.instanceMethod();
            }
        }
    
        // in an object literal inside a instance method
        public objectLiteralInsideAnInstanceMethod() {
            return {
                a: () => {
                    super.instanceMethod();
                },
                b: super.instanceMethod()
            };
        }
    
        // in a getter
        public get accessor() {
                   ~~~~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            super.instanceMethod();
    
            return 0;
        }
    
        // in a setter
        public set accessor(value: number) {
                   ~~~~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
            super.instanceMethod();
        }
        
        constructor() {
            super();
            super.instanceMethod();
        }
        
        public propertyInitializer = super.instanceMethod();
        
        public functionProperty = () => {super.instanceMethod(); };
    }