This is as minimal an example as I have for now (tsc version and tsconfig.json details at the bottom of this issue)
class A {
doIt(x: Array<string>): void {
x.forEach((v) => {
switch(v) {
case "test": console.log(this);
}
});
}
}
Comparing the transpiled output from 1.8.0-dev.20151109 and 1.8.0-dev.20151110 we see:
--- app.js.1.8.0-dev.20151109 2015-11-12 16:02:01.064780316 +0000
+++ app.js.1.8.0-dev.20151110 2015-11-12 16:05:07.933061708 +0000
@@ -2,10 +2,9 @@
function A() {
}
A.prototype.doIt = function (x) {
- var _this = this;
x.forEach(function (v) {
switch (v) {
- case "test": console.log(_this);
+ case "test": console.log(this);
}
});
};
This feels like a bug to me... but I might have missed something?
Thanks
message TS6029: Version 1.8.0-dev.20151110
{
"compilerOptions": {
"declaration": false,
"jsx": "react",
"module": "system",
"noImplicitAny": true,
"noLib": true,
"outDir": "../dist/",
"removeComments": false,
"rootDir": ".",
"sourceMap": true,
"target": "es5"
}
}
This is as minimal an example as I have for now (
tscversion andtsconfig.jsondetails at the bottom of this issue)Comparing the transpiled output from
1.8.0-dev.20151109and1.8.0-dev.20151110we see:This feels like a bug to me... but I might have missed something?
Thanks