Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update flow tests and fix underscore being a reserved type
- Loading branch information
Showing
6 changed files
with
695 additions
and
2 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
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
8 changes: 8 additions & 0 deletions
8
...parser/test/fixtures/flow/type-annotations/underscore_is_allowed_trailing_commas/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,8 @@ | ||
//@flow | ||
test< | ||
_, | ||
_, | ||
number, | ||
_, | ||
_, | ||
>(); |
283 changes: 283 additions & 0 deletions
283
...ser/test/fixtures/flow/type-annotations/underscore_is_allowed_trailing_commas/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,283 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 48, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"column": 4 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 48, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"column": 4 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 8, | ||
"end": 48, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"column": 4 | ||
} | ||
}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start": 8, | ||
"end": 47, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"column": 3 | ||
} | ||
}, | ||
"callee": { | ||
"type": "Identifier", | ||
"start": 8, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 4 | ||
}, | ||
"identifierName": "test" | ||
}, | ||
"name": "test" | ||
}, | ||
"typeArguments": { | ||
"type": "TypeParameterInstantiation", | ||
"start": 12, | ||
"end": 45, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"column": 1 | ||
} | ||
}, | ||
"params": [ | ||
{ | ||
"type": "GenericTypeAnnotation", | ||
"start": 16, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 3 | ||
} | ||
}, | ||
"typeParameters": null, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 16, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 3 | ||
}, | ||
"identifierName": "_" | ||
}, | ||
"name": "_" | ||
} | ||
}, | ||
{ | ||
"type": "GenericTypeAnnotation", | ||
"start": 21, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 4, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 3 | ||
} | ||
}, | ||
"typeParameters": null, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 21, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 4, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 3 | ||
}, | ||
"identifierName": "_" | ||
}, | ||
"name": "_" | ||
} | ||
}, | ||
{ | ||
"type": "NumberTypeAnnotation", | ||
"start": 26, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 5, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"column": 8 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "GenericTypeAnnotation", | ||
"start": 36, | ||
"end": 37, | ||
"loc": { | ||
"start": { | ||
"line": 6, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"column": 3 | ||
} | ||
}, | ||
"typeParameters": null, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 36, | ||
"end": 37, | ||
"loc": { | ||
"start": { | ||
"line": 6, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"column": 3 | ||
}, | ||
"identifierName": "_" | ||
}, | ||
"name": "_" | ||
} | ||
}, | ||
{ | ||
"type": "GenericTypeAnnotation", | ||
"start": 41, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 7, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 3 | ||
} | ||
}, | ||
"typeParameters": null, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 41, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 7, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 3 | ||
}, | ||
"identifierName": "_" | ||
}, | ||
"name": "_" | ||
} | ||
} | ||
] | ||
}, | ||
"arguments": [] | ||
}, | ||
"leadingComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": "@flow", | ||
"start": 0, | ||
"end": 7, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"directives": [] | ||
}, | ||
"comments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": "@flow", | ||
"start": 0, | ||
"end": 7, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
} | ||
} | ||
] | ||
} |
2 changes: 2 additions & 0 deletions
2
...rser/test/fixtures/flow/type-annotations/underscore_is_implicit_anywhere_in_list/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 | ||
test<number, _, string, _, _, _, Foo, Bar, Baz>(); |
Oops, something went wrong.