fix: add optional: false to chained optional call expression (#11814)

This commit is contained in:
Huáng Jùnliàng
2020-07-09 20:33:50 -04:00
committed by GitHub
parent f32d5debda
commit 02c8fd92bd
5 changed files with 8 additions and 1 deletions

View File

@@ -660,8 +660,10 @@ export default class ExpressionParser extends LValParser {
let node = this.startNodeAt(startPos, startLoc);
node.callee = base;
if (state.optionalChainMember) {
node.optional = optional;
}
if (optional) {
node.optional = true;
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
} else {
node.arguments = this.parseCallExpressionArguments(