Merge pull request #25507 from ajafff/leftmost-expr-tagged-template

getLeftmostExpression: handle TaggedTemplateExpression
This commit is contained in:
Daniel Rosenwasser 2018-07-13 23:56:32 -07:00 committed by GitHub
commit 60986adee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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")]));