mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
940 B
TypeScript
43 lines
940 B
TypeScript
//// [tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts] ////
|
|
|
|
//// [collisionThisExpressionAndLocalVarInMethod.ts]
|
|
class a {
|
|
method1() {
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
var _this = 2;
|
|
return callback(this);
|
|
}
|
|
}
|
|
}
|
|
method2() {
|
|
var _this = 2;
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
return callback(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//// [collisionThisExpressionAndLocalVarInMethod.js]
|
|
"use strict";
|
|
class a {
|
|
method1() {
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
var _this = 2;
|
|
return callback(this);
|
|
}
|
|
};
|
|
}
|
|
method2() {
|
|
var _this = 2;
|
|
return {
|
|
doStuff: (callback) => () => {
|
|
return callback(this);
|
|
}
|
|
};
|
|
}
|
|
}
|