Skip to content

Commit

Permalink
Merge pull request #1674 from UnwrittenFun/fix/object-array-pattern-end
Browse files Browse the repository at this point in the history
add end position to object and array patterns
  • Loading branch information
Rich-Harris authored Aug 23, 2018
2 parents 9eec6f8 + df4ca01 commit 1ccc454
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/parse/read/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default function readContext(parser: Parser) {

errorOnAssignmentPattern(parser);
parser.eat(']', true);
context.end = parser.index;
}

else if (parser.eat('{')) {
Expand Down Expand Up @@ -95,6 +96,7 @@ export default function readContext(parser: Parser) {

errorOnAssignmentPattern(parser);
parser.eat('}', true);
context.end = parser.index;
}

else {
Expand Down
2 changes: 1 addition & 1 deletion test/parser/samples/each-block-destructured/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
],
"context": {
"start": 18,
"end": null,
"end": 30,
"type": "ArrayPattern",
"elements": [
{
Expand Down

0 comments on commit 1ccc454

Please sign in to comment.