From f8fbc22ef23e7c4bc5c2b75af30fb532d2208cb6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Sep 2016 14:35:57 -0700 Subject: [PATCH] Reuse the 'captureThisForNode' function. --- src/compiler/transformers/es6.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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; }