Extend the MetaProperty check to work for new.target too

This commit is contained in:
Eli Barzilay
2021-02-22 18:30:17 -05:00
parent d495957065
commit 67f55aabd7
5 changed files with 93 additions and 4 deletions

View File

@@ -21322,10 +21322,8 @@ namespace ts {
switch (source.kind) {
case SyntaxKind.MetaProperty:
return target.kind === SyntaxKind.MetaProperty
&& (source as MetaProperty).keywordToken === SyntaxKind.ImportKeyword
&& (target as MetaProperty).keywordToken === SyntaxKind.ImportKeyword
&& (source as MetaProperty).name.escapedText === "meta"
&& (target as MetaProperty).name.escapedText === "meta";
&& (source as MetaProperty).keywordToken === (target as MetaProperty).keywordToken
&& (source as MetaProperty).name.escapedText === (target as MetaProperty).name.escapedText;
case SyntaxKind.Identifier:
case SyntaxKind.PrivateIdentifier:
return target.kind === SyntaxKind.Identifier && getResolvedSymbol(<Identifier>source) === getResolvedSymbol(<Identifier>target) ||