[ts]Add optional property to OptionalCallExpression node that has type arguments (#12562)

This commit is contained in:
Sosuke Suzuki
2021-01-06 23:41:45 +09:00
committed by GitHub
parent 584518d04c
commit c1473e30b2
4 changed files with 67 additions and 4 deletions

View File

@@ -1889,6 +1889,10 @@ export default (superClass: Class<Parser>): Class<Parser> =>
this.tsCheckForInvalidTypeCasts(node.arguments);
node.typeParameters = typeArguments;
if (state.optionalChainMember) {
// $FlowIgnore
node.optional = false;
}
return this.finishCallExpression(node, state.optionalChainMember);
} else if (this.match(tt.backQuote)) {
const result = this.parseTaggedTemplateExpression(