diff --git a/src/parse/read/context.ts b/src/parse/read/context.ts index 77fd2cbf68..13d1e9ece1 100644 --- a/src/parse/read/context.ts +++ b/src/parse/read/context.ts @@ -57,6 +57,7 @@ export default function readContext(parser: Parser) { errorOnAssignmentPattern(parser); parser.eat(']', true); + context.end = parser.index; } else if (parser.eat('{')) { @@ -95,6 +96,7 @@ export default function readContext(parser: Parser) { errorOnAssignmentPattern(parser); parser.eat('}', true); + context.end = parser.index; } else { diff --git a/test/parser/samples/each-block-destructured/output.json b/test/parser/samples/each-block-destructured/output.json index 554b0cdcb0..eba70b8750 100644 --- a/test/parser/samples/each-block-destructured/output.json +++ b/test/parser/samples/each-block-destructured/output.json @@ -55,7 +55,7 @@ ], "context": { "start": 18, - "end": null, + "end": 30, "type": "ArrayPattern", "elements": [ {