Skip to content

Commit e5e8c6b

Browse files
committed
Add explanatory comment when adding ContainsLexicalThisInComputedPropertyName
1 parent 8fa44c3 commit e5e8c6b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/compiler/binder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,9 @@ namespace ts {
19111911
// Instead, we mark the container as ES6, so that it can properly handle the transform.
19121912
transformFlags = TransformFlags.ContainsComputedPropertyName;
19131913
if (subtreeFlags & TransformFlags.ContainsLexicalThis) {
1914+
// A computed method name that contains `this` needs to
1915+
// distinguish itself from the normal case of a method body containing `this`.
1916+
// So convert ContainsLexicalThis to ContainsLexicalThisInComputedPropertyName
19141917
transformFlags |= TransformFlags.ContainsLexicalThisInComputedPropertyName;
19151918
}
19161919
break;

0 commit comments

Comments
 (0)