mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Merge pull request #25507 from ajafff/leftmost-expr-tagged-template
getLeftmostExpression: handle TaggedTemplateExpression
This commit is contained in:
commit
60986adee5
@ -4355,6 +4355,11 @@ namespace ts {
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
node = (<ConditionalExpression>node).condition;
|
||||
continue;
|
||||
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
node = (<TaggedTemplateExpression>node).tag;
|
||||
continue;
|
||||
|
||||
case SyntaxKind.CallExpression:
|
||||
if (stopAtCallExpressions) {
|
||||
return node;
|
||||
|
||||
@ -21,6 +21,7 @@ namespace ts {
|
||||
const func = createFunctionExpression(/*modifiers*/ undefined, /*asteriskToken*/ undefined, "fn", /*typeParameters*/ undefined, /*parameters*/ undefined, /*type*/ undefined, createBlock([]));
|
||||
checkExpression(func);
|
||||
checkExpression(createCall(func, /*typeArguments*/ undefined, /*argumentsArray*/ undefined));
|
||||
checkExpression(createTaggedTemplate(func, createNoSubstitutionTemplateLiteral("")));
|
||||
|
||||
checkExpression(createBinary(createLiteral("a"), SyntaxKind.CommaToken, createLiteral("b")));
|
||||
checkExpression(createCommaList([createLiteral("a"), createLiteral("b")]));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user