fix: correctly set innerEndPos in CoverParenthesizedExpressionAndArrowParameterList (#11847)
This commit is contained in:
parent
8f191ead92
commit
f4eeff947d
@ -1371,8 +1371,8 @@ export default class ExpressionParser extends LValParser {
|
||||
}
|
||||
}
|
||||
|
||||
const innerEndPos = this.state.start;
|
||||
const innerEndLoc = this.state.startLoc;
|
||||
const innerEndPos = this.state.lastTokEnd;
|
||||
const innerEndLoc = this.state.lastTokEndLoc;
|
||||
this.expect(tt.parenR);
|
||||
|
||||
this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
|
||||
|
||||
4
packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/input.js
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/input.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
a = (
|
||||
b,
|
||||
c
|
||||
)
|
||||
47
packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json
vendored
Normal file
47
packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
||||
"expression": {
|
||||
"type": "AssignmentExpression",
|
||||
"start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
||||
"operator": "=",
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"},
|
||||
"name": "a"
|
||||
},
|
||||
"right": {
|
||||
"type": "SequenceExpression",
|
||||
"start":8,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":3}},
|
||||
"expressions": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start":8,"end":9,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"b"},
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start":13,"end":14,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"c"},
|
||||
"name": "c"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"parenthesized": true,
|
||||
"parenStart": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user