From 944bcf8459efe8eb678e0fde8e6fcb78add26eeb Mon Sep 17 00:00:00 2001 From: Wenlu Wang Date: Thu, 2 Apr 2020 10:29:28 +0800 Subject: [PATCH] Update src/compiler/transformers/utilities.ts Co-Authored-By: Daniel Rosenwasser --- src/compiler/transformers/utilities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/transformers/utilities.ts b/src/compiler/transformers/utilities.ts index a54d1d05e5..b4d01704f6 100644 --- a/src/compiler/transformers/utilities.ts +++ b/src/compiler/transformers/utilities.ts @@ -282,7 +282,8 @@ namespace ts { export function shouldCaptureInTempVariable(expression: Expression): boolean { // don't capture identifiers and `this` in a temporary variable - // `super` cannot be captured as it's no real variable + // `super` cannot be captured as it's not a real variable + return !isIdentifier(expression) && expression.kind !== SyntaxKind.ThisKeyword && expression.kind !== SyntaxKind.SuperKeyword;