Correctly eat a semicolon at the end of DelcareModuleExports
This commit is contained in:
parent
c30a556615
commit
ad88d461d3
@ -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");
|
||||
};
|
||||
|
||||
|
||||
1
test/fixtures/flow/declare-module/9/actual.js
vendored
Normal file
1
test/fixtures/flow/declare-module/9/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
declare module A { declare module.exports: number; }
|
||||
128
test/fixtures/flow/declare-module/9/expected.json
vendored
Normal file
128
test/fixtures/flow/declare-module/9/expected.json
vendored
Normal 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": []
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user