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

Commit

Permalink
Fix accidental fall-through in Flow type parsing.
Browse files Browse the repository at this point in the history
When parsing a primary type, `>` would erroneously be treated like `(`.
  • Loading branch information
max-schaefer committed Jul 26, 2016
1 parent 88d7e20 commit 820f474
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ pp.flowParsePrimaryType = function () {
node.returnType = this.flowParseType();

return this.finishNode(node, "FunctionTypeAnnotation");
} else {
this.unexpected();
}

case tt.parenL:
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/flow/type-annotations/106/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var f: >x:int) => string;
3 changes: 3 additions & 0 deletions test/fixtures/flow/type-annotations/106/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:7)"
}

0 comments on commit 820f474

Please sign in to comment.