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

Backport #565 #571

Merged
merged 1 commit into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ pp.flowParseFunctionTypeParam = function () {
};

pp.reinterpretTypeAsFunctionTypeParam = function (type) {
const node = this.startNodeAt(type.start, type.loc);
const node = this.startNodeAt(type.start, type.loc.start);
node.name = null;
node.optional = false;
node.typeAnnotation = type;
Expand Down Expand Up @@ -787,7 +787,7 @@ pp.flowParsePrefixType = function () {
pp.flowParseAnonFunctionWithoutParens = function () {
const param = this.flowParsePrefixType();
if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {
const node = this.startNodeAt(param.start, param.loc);
const node = this.startNodeAt(param.start, param.loc.start);
node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
node.rest = null;
node.returnType = this.flowParseType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@
"end": 23,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 15
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand All @@ -87,14 +81,8 @@
"end": 18,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 15
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@
"end": 30,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 22
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand All @@ -87,14 +81,8 @@
"end": 25,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 22
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 20
}
"line": 1,
"column": 14
},
"end": {
"line": 1,
Expand All @@ -129,14 +123,8 @@
"end": 23,
"loc": {
"start": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 20
}
"line": 1,
"column": 14
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,8 @@
"end": 35,
"loc": {
"start": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 24
}
"line": 1,
"column": 18
},
"end": {
"line": 1,
Expand All @@ -117,14 +111,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 24
}
"line": 1,
"column": 18
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,8 @@
"end": 35,
"loc": {
"start": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 24
}
"line": 1,
"column": 18
},
"end": {
"line": 1,
Expand All @@ -117,14 +111,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 24
}
"line": 1,
"column": 18
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 16
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand All @@ -87,14 +81,8 @@
"end": 19,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 16
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@
"end": 28,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand All @@ -87,14 +81,8 @@
"end": 20,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 16
}
},
"end": {
"line": 1,
"column": 27
}
"line": 1,
"column": 10
},
"end": {
"line": 1,
Expand All @@ -109,14 +97,8 @@
"end": 27,
"loc": {
"start": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 16
}
"line": 1,
"column": 10
},
"end": {
"line": 1,
Expand All @@ -130,14 +112,8 @@
"end": 19,
"loc": {
"start": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 16
}
"line": 1,
"column": 10
},
"end": {
"line": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@
"end": 35,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 15
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand All @@ -87,14 +81,8 @@
"end": 18,
"loc": {
"start": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 15
}
"line": 1,
"column": 9
},
"end": {
"line": 1,
Expand Down
Loading