Skip to content

Commit 60986ad

Browse files
Merge pull request #25507 from ajafff/leftmost-expr-tagged-template
getLeftmostExpression: handle TaggedTemplateExpression
2 parents e25a23b + 165a87a commit 60986ad

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/compiler/factory.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,6 +4355,11 @@ namespace ts {
43554355
case SyntaxKind.ConditionalExpression:
43564356
node = (<ConditionalExpression>node).condition;
43574357
continue;
4358+
4359+
case SyntaxKind.TaggedTemplateExpression:
4360+
node = (<TaggedTemplateExpression>node).tag;
4361+
continue;
4362+
43584363
case SyntaxKind.CallExpression:
43594364
if (stopAtCallExpressions) {
43604365
return node;

src/testRunner/unittests/factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace ts {
2121
const func = createFunctionExpression(/*modifiers*/ undefined, /*asteriskToken*/ undefined, "fn", /*typeParameters*/ undefined, /*parameters*/ undefined, /*type*/ undefined, createBlock([]));
2222
checkExpression(func);
2323
checkExpression(createCall(func, /*typeArguments*/ undefined, /*argumentsArray*/ undefined));
24+
checkExpression(createTaggedTemplate(func, createNoSubstitutionTemplateLiteral("")));
2425

2526
checkExpression(createBinary(createLiteral("a"), SyntaxKind.CommaToken, createLiteral("b")));
2627
checkExpression(createCommaList([createLiteral("a"), createLiteral("b")]));

0 commit comments

Comments
 (0)