diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index b48b320d0d1..5ed1e9665d5 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1911,6 +1911,9 @@ namespace ts { // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags = TransformFlags.ContainsComputedPropertyName; if (subtreeFlags & TransformFlags.ContainsLexicalThis) { + // A computed method name that contains `this` needs to + // distinguish itself from the normal case of a method body containing `this`. + // So convert ContainsLexicalThis to ContainsLexicalThisInComputedPropertyName transformFlags |= TransformFlags.ContainsLexicalThisInComputedPropertyName; } break;