TypeScript/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt
2014-07-18 16:16:28 -07:00

23 lines
801 B
Plaintext

==== tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts (2 errors) ====
class a {
method1() {
return {
doStuff: (callback) => () => {
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
return callback(this);
}
}
}
method2() {
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
return {
doStuff: (callback) => () => {
return callback(this);
}
}
}
}