diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index df21df5e1fb..b0633c309ea 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -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; }