fix: add optional: false to chained optional call expression (#11814)
This commit is contained in:
parent
f32d5debda
commit
02c8fd92bd
@ -660,8 +660,10 @@ export default class ExpressionParser extends LValParser {
|
|||||||
let node = this.startNodeAt(startPos, startLoc);
|
let node = this.startNodeAt(startPos, startLoc);
|
||||||
node.callee = base;
|
node.callee = base;
|
||||||
|
|
||||||
|
if (state.optionalChainMember) {
|
||||||
|
node.optional = optional;
|
||||||
|
}
|
||||||
if (optional) {
|
if (optional) {
|
||||||
node.optional = true;
|
|
||||||
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
|
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
|
||||||
} else {
|
} else {
|
||||||
node.arguments = this.parseCallExpressionArguments(
|
node.arguments = this.parseCallExpressionArguments(
|
||||||
|
|||||||
@ -39,6 +39,7 @@
|
|||||||
"computed": false,
|
"computed": false,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"optional": false,
|
||||||
"arguments": []
|
"arguments": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -257,6 +257,7 @@
|
|||||||
"computed": false,
|
"computed": false,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
|
"optional": false,
|
||||||
"arguments": [
|
"arguments": [
|
||||||
{
|
{
|
||||||
"type": "NumericLiteral",
|
"type": "NumericLiteral",
|
||||||
@ -303,6 +304,7 @@
|
|||||||
"computed": false,
|
"computed": false,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
|
"optional": false,
|
||||||
"arguments": []
|
"arguments": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -93,6 +93,7 @@
|
|||||||
"computed": false,
|
"computed": false,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"optional": false,
|
||||||
"arguments": []
|
"arguments": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,7 @@
|
|||||||
"computed": false,
|
"computed": false,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
|
"optional": false,
|
||||||
"arguments": [
|
"arguments": [
|
||||||
{
|
{
|
||||||
"type": "NumericLiteral",
|
"type": "NumericLiteral",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user