Skip to content

Commit f8fbc22

Browse files
Reuse the 'captureThisForNode' function.
1 parent e0c35f2 commit f8fbc22

File tree

1 file changed

+1
-14
lines changed
  • src/compiler/transformers

1 file changed

+1
-14
lines changed

src/compiler/transformers/es6.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -965,21 +965,8 @@ namespace ts {
965965

966966
// The constructor was generated for some reason.
967967
// Create a captured '_this' variable.
968-
statements.push(
969-
createVariableStatement(
970-
/*modifiers*/ undefined,
971-
createVariableDeclarationList([
972-
createVariableDeclaration(
973-
"_this",
974-
/*type*/ undefined,
975-
superReturnValueOrThis
976-
)
977-
]),
978-
/*location*/ extendsClauseElement)
979-
);
980-
968+
captureThisForNode(statements, constructor, superReturnValueOrThis);
981969
enableSubstitutionsForCapturedThis();
982-
983970
return SuperCaptureResult.ReplaceSuperCapture;
984971
}
985972

0 commit comments

Comments
 (0)