Add explanatory comment when adding ContainsLexicalThisInComputedPropertyName

This commit is contained in:
Nathan Shively-Sanders 2016-04-13 16:14:29 -07:00
parent 8fa44c3b06
commit e5e8c6b0b9

View File

@ -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;