Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some incorrect typeof parsing in flow
- Loading branch information
1 parent
c2bace4
commit b685ef8
Showing
30 changed files
with
3,581 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...el-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @flow | ||
interface I extends X, bool {} |
197 changes: 197 additions & 0 deletions
197
...parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 39, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 30 | ||
} | ||
}, | ||
"errors": [ | ||
"SyntaxError: Unexpected reserved type bool (2:23)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 39, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 30 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "InterfaceDeclaration", | ||
"start": 9, | ||
"end": 39, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 30 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 19, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 11 | ||
}, | ||
"identifierName": "I" | ||
}, | ||
"name": "I" | ||
}, | ||
"typeParameters": null, | ||
"extends": [ | ||
{ | ||
"type": "InterfaceExtends", | ||
"start": 29, | ||
"end": 30, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 21 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 29, | ||
"end": 30, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 21 | ||
}, | ||
"identifierName": "X" | ||
}, | ||
"name": "X" | ||
}, | ||
"typeParameters": null | ||
}, | ||
{ | ||
"type": "InterfaceExtends", | ||
"start": 32, | ||
"end": 36, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 23 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 27 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 32, | ||
"end": 36, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 23 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 27 | ||
}, | ||
"identifierName": "bool" | ||
}, | ||
"name": "bool" | ||
}, | ||
"typeParameters": null | ||
} | ||
], | ||
"implements": [], | ||
"mixins": [], | ||
"body": { | ||
"type": "ObjectTypeAnnotation", | ||
"start": 37, | ||
"end": 39, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 30 | ||
} | ||
}, | ||
"callProperties": [], | ||
"properties": [], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
}, | ||
"leadingComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " @flow", | ||
"start": 0, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"directives": [] | ||
}, | ||
"comments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " @flow", | ||
"start": 0, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
] | ||
} |
2 changes: 2 additions & 0 deletions
2
...el-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @flow | ||
interface I extends X, bool.m {} |
Oops, something went wrong.