TypeScript/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt

23 lines
801 B
Plaintext
Raw Normal View History

2014-07-19 01:13:21 +02:00
==== 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);
}
}
}
}