mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Don't emit '_this' declaration in ES6 or later.
This commit is contained in:
parent
c25170558e
commit
fb8cc0c40a
@ -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
|
||||
|
||||
@ -23,7 +23,6 @@ class Base {
|
||||
}
|
||||
class C extends Base {
|
||||
foo() {
|
||||
var _this = this;
|
||||
(() => {
|
||||
var obj = {
|
||||
[super.bar()]() { } // needs capture
|
||||
|
||||
@ -18,7 +18,6 @@ class Parent {
|
||||
}
|
||||
class Foo extends Parent {
|
||||
foo() {
|
||||
var _this = this;
|
||||
var x = () => super.foo();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user