Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Change location of ObjectTypeIndexer to match flow (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez authored Jan 27, 2017
1 parent c424156 commit e614032
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/plugins/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,11 @@ pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) {
node.value = this.flowParseTypeInitialiser();
node.variance = variance;

// Finish node first to not include a possible semicolon in the locations
const indexer = this.finishNode(node, "ObjectTypeIndexer");
this.flowObjectTypeSemicolon();
return this.finishNode(node, "ObjectTypeIndexer");

return indexer;
};

pp.flowParseObjectTypeMethodish = function (node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@
{
"type": "ObjectTypeIndexer",
"start": 23,
"end": 47,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 47
"column": 46
}
},
"id": {
Expand Down Expand Up @@ -194,4 +194,4 @@
]
},
"comments": []
}
}
10 changes: 5 additions & 5 deletions test/fixtures/flow/type-annotations/41/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@
{
"type": "ObjectTypeIndexer",
"start": 9,
"end": 29,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 29
"column": 28
}
},
"id": {
Expand Down Expand Up @@ -167,15 +167,15 @@
{
"type": "ObjectTypeIndexer",
"start": 30,
"end": 50,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 50
"column": 49
}
},
"id": {
Expand Down Expand Up @@ -238,4 +238,4 @@
]
},
"comments": []
}
}

0 comments on commit e614032

Please sign in to comment.