2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
|
|
tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts(14,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
|
|
|
|
|
|
|
|
2014-07-19 01:13:21 +02:00
|
|
|
==== tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts (2 errors) ====
|
|
|
|
class class1 {
|
|
|
|
constructor() {
|
|
|
|
var x2 = {
|
|
|
|
doStuff: (callback) => () => {
|
|
|
|
var _this = 2;
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
2014-07-19 01:13:21 +02:00
|
|
|
return callback(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class class2 {
|
|
|
|
constructor() {
|
|
|
|
var _this = 2;
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
|
2014-07-19 01:13:21 +02:00
|
|
|
var x2 = {
|
|
|
|
doStuff: (callback) => () => {
|
|
|
|
return callback(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|