Closed
Description
tested on 690b87c
source code.
new class {
hi() {
return "Hi!";
}
}().hi();
expected.
new ((function () {
function class_1() {
}
class_1.prototype.hi = function () {
return "Hi!";
};
return class_1;
})())().hi();
actual.
new (function () {
function class_1() {
}
class_1.prototype.hi = function () {
return "Hi!";
};
return class_1;
})()().hi();
$ tsc --target es5 test.ts
$ node test.js
/private/tmp/tsc-1.6/test.js:8
})()().hi();
^
TypeError: Cannot read property 'hi' of undefined
at Object.<anonymous> (/private/tmp/tsc-1.6/test.js:8:7)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:471:10)
at startup (node.js:117:18)
at node.js:951:3