Reuse the 'captureThisForNode' function.

This commit is contained in:
Daniel Rosenwasser 2016-09-27 14:35:57 -07:00
parent e0c35f2c82
commit f8fbc22ef2

View File

@ -965,21 +965,8 @@ namespace ts {
// The constructor was generated for some reason.
// Create a captured '_this' variable.
statements.push(
createVariableStatement(
/*modifiers*/ undefined,
createVariableDeclarationList([
createVariableDeclaration(
"_this",
/*type*/ undefined,
superReturnValueOrThis
)
]),
/*location*/ extendsClauseElement)
);
captureThisForNode(statements, constructor, superReturnValueOrThis);
enableSubstitutionsForCapturedThis();
return SuperCaptureResult.ReplaceSuperCapture;
}