Add support for null literal type

This commit is contained in:
Amjad Masad
2015-12-03 23:58:25 -08:00
parent 5a15231cfe
commit e3da84bcc3
3 changed files with 120 additions and 0 deletions

View File

@@ -514,6 +514,11 @@ pp.flowParsePrimaryType = function () {
this.next();
return this.finishNode(node, "NumericLiteralTypeAnnotation");
case tt._null:
node.value = this.match(tt._null);
this.next();
return this.finishNode(node, "NullLiteralTypeAnnotation");
default:
if (this.state.type.keyword === "typeof") {
return this.flowParseTypeofType();