Don't emit '_this' declaration in ES6 or later.

This commit is contained in:
Daniel Rosenwasser 2015-04-09 16:29:38 -07:00
parent c25170558e
commit fb8cc0c40a
3 changed files with 1 additions and 3 deletions

View File

@ -5582,7 +5582,7 @@ module ts {
needToCaptureLexicalThis = false;
while (container && container.kind === SyntaxKind.ArrowFunction) {
container = getSuperContainer(container, /*includeFunctions*/ true);
needToCaptureLexicalThis = true;
needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6;
}
// topmost container must be something that is directly nested in the class declaration

View File

@ -23,7 +23,6 @@ class Base {
}
class C extends Base {
foo() {
var _this = this;
(() => {
var obj = {
[super.bar()]() { } // needs capture

View File

@ -18,7 +18,6 @@ class Parent {
}
class Foo extends Parent {
foo() {
var _this = this;
var x = () => super.foo();
}
}