File: collisionThisExpressionAndLocalVarInProperty.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 (28 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download | duplicates (2)
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
tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(4,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(12,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.


==== tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts (2 errors) ====
    class class1 {
        public prop1 = {
            doStuff: (callback) => () => {
                var _this = 2;
                    ~~~~~
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
                return callback(this);
            }
        }
    }
    
    class class2 {
        constructor() {
            var _this = 2;
                ~~~~~
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
        }
        public prop1 = {
            doStuff: (callback) => () => {
                return callback(this);
            }
        }
    }