mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Merge pull request #331 from Microsoft/capture_this_in_constructors
emit this capturing as a first action in the constructor.
This commit is contained in:
@@ -1371,6 +1371,7 @@ module ts {
|
||||
write(" {");
|
||||
scopeEmitStart(node, "constructor");
|
||||
increaseIndent();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
if (ctor) {
|
||||
emitDefaultValueAssignments(ctor);
|
||||
emitRestParameter(ctor);
|
||||
@@ -1390,8 +1391,7 @@ module ts {
|
||||
write("_super.apply(this, arguments);");
|
||||
emitEnd(node.baseType);
|
||||
}
|
||||
}
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
}
|
||||
emitMemberAssignments(node, /*nonstatic*/0);
|
||||
if (ctor) {
|
||||
var statements: Node[] = (<Block>ctor.body).statements;
|
||||
|
||||
Reference in New Issue
Block a user