Correctly eat a semicolon at the end of DelcareModuleExports

This commit is contained in:
Daniel Tschinder 2016-11-13 14:29:46 +01:00
parent c30a556615
commit ad88d461d3
No known key found for this signature in database
GPG Key ID: 0F9471CB6816A4FF
3 changed files with 131 additions and 0 deletions

View File

@ -117,6 +117,8 @@ pp.flowParseDeclareModuleExports = function (node) {
this.expect(tt.dot);
this.expectContextual("exports");
node.typeAnnotation = this.flowParseTypeAnnotation();
this.semicolon();
return this.finishNode(node, "DeclareModuleExports");
};

View File

@ -0,0 +1 @@
declare module A { declare module.exports: number; }

View File

@ -0,0 +1,128 @@
{
"type": "File",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
},
"program": {
"type": "Program",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
},
"sourceType": "module",
"body": [
{
"type": "DeclareModule",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
},
"id": {
"type": "Identifier",
"start": 15,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "A"
},
"name": "A"
},
"body": {
"type": "BlockStatement",
"start": 17,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 52
}
},
"body": [
{
"type": "DeclareModuleExports",
"start": 19,
"end": 50,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 50
}
},
"typeAnnotation": {
"type": "TypeAnnotation",
"start": 41,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 41
},
"end": {
"line": 1,
"column": 49
}
},
"typeAnnotation": {
"type": "NumberTypeAnnotation",
"start": 43,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 43
},
"end": {
"line": 1,
"column": 49
}
}
}
}
}
]
}
}
],
"directives": []
}
}