Merge pull request #1674 from UnwrittenFun/fix/object-array-pattern-end

add end position to object and array patterns
pull/1677/head
Rich Harris 6 years ago committed by GitHub
commit 1ccc45426c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,6 +57,7 @@ export default function readContext(parser: Parser) {
errorOnAssignmentPattern(parser); errorOnAssignmentPattern(parser);
parser.eat(']', true); parser.eat(']', true);
context.end = parser.index;
} }
else if (parser.eat('{')) { else if (parser.eat('{')) {
@ -95,6 +96,7 @@ export default function readContext(parser: Parser) {
errorOnAssignmentPattern(parser); errorOnAssignmentPattern(parser);
parser.eat('}', true); parser.eat('}', true);
context.end = parser.index;
} }
else { else {

@ -55,7 +55,7 @@
], ],
"context": { "context": {
"start": 18, "start": 18,
"end": null, "end": 30,
"type": "ArrayPattern", "type": "ArrayPattern",
"elements": [ "elements": [
{ {

Loading…
Cancel
Save