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

Commit

Permalink
Add EmptyTypeAnnotation (#171)
Browse files Browse the repository at this point in the history
I also noticed that there was missing test coverage for builtin types,
so I added a test for that, which includes the newly added type as well
as the other existing types.
  • Loading branch information
samwgoldman authored and hzoo committed Oct 13, 2016
1 parent c300230 commit 44f77bd
Show file tree
Hide file tree
Showing 3 changed files with 830 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plugins/flow.js
Expand Up @@ -499,6 +499,9 @@ pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) {
case "mixed":
return this.finishNode(node, "MixedTypeAnnotation");

case "empty":
return this.finishNode(node, "EmptyTypeAnnotation");

case "number":
return this.finishNode(node, "NumberTypeAnnotation");

Expand Down
16 changes: 16 additions & 0 deletions test/fixtures/flow/type-annotations/builtin/actual.js
@@ -0,0 +1,16 @@
// bounds
type T = any;
type T = mixed;
type T = empty;
// builtins
type T = void;
type T = number;
type T = string;
type T = bool;
type T = boolean;
// literal type annotations
type T = null;
type T = "";
type T = 0;
type T = true;
type T = false;

0 comments on commit 44f77bd

Please sign in to comment.