getLeftmostExpression: handle TaggedTemplateExpression

This commit is contained in:
Klaus Meinhardt 2018-07-08 21:25:09 +02:00
parent 10b174abc1
commit 165a87affa
2 changed files with 6 additions and 0 deletions

View File

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

View File

@ -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")]));