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 2bebe36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ pp.flowParsePrimaryType = function () {

return this.finishNode(node, "FunctionTypeAnnotation");
}
break;

case tt.parenL:
this.next();
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 2bebe36

Please sign in to comment.