mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 10:40:34 -05:00
fix(44725): handle this parameter in tagged template call (#44734)
This commit is contained in:
@@ -28724,8 +28724,10 @@ namespace ts {
|
||||
* Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise.
|
||||
*/
|
||||
function getThisArgumentOfCall(node: CallLikeExpression): LeftHandSideExpression | undefined {
|
||||
if (node.kind === SyntaxKind.CallExpression) {
|
||||
const callee = skipOuterExpressions(node.expression);
|
||||
const expression = node.kind === SyntaxKind.CallExpression ? node.expression :
|
||||
node.kind === SyntaxKind.TaggedTemplateExpression ? node.tag : undefined;
|
||||
if (expression) {
|
||||
const callee = skipOuterExpressions(expression);
|
||||
if (isAccessExpression(callee)) {
|
||||
return callee.expression;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user