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

60 lines
2 KiB
Plaintext

==== tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts (8 errors) ====
class class1 {
get a(): number {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
var x2 = {
doStuff: (callback) => () => {
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
return callback(this);
}
}
return 10;
}
set a(val: number) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
var x2 = {
doStuff: (callback) => () => {
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
return callback(this);
}
}
}
}
class class2 {
get a(): number {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
var x2 = {
doStuff: (callback) => () => {
return callback(this);
}
}
return 10;
}
set a(val: number) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
var _this = 2;
~~~~~
!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
var x2 = {
doStuff: (callback) => () => {
return callback(this);
}
}
}
}