Merge pull request #3305 from jviereck/T7052

Fix: Arrow functions with trailing comma + return type are throwing an error when parsing
This commit is contained in:
Amjad Masad
2016-02-05 13:50:57 -08:00
5 changed files with 210 additions and 3 deletions

View File

@@ -1038,7 +1038,7 @@ export default function (instance) {
return this.parseArrowExpression(node, [], isAsync);
} else {
// let foo = (foo): number => {};
let node = inner.call(this, startPos, startLoc, canBeArrow, isAsync);
let node = inner.call(this, startPos, startLoc, canBeArrow, isAsync, this.hasPlugin("trailingFunctionCommas"));
if (this.match(tt.colon)) {
let state = this.state.clone();