[ts] Add parser test: destructuring-with-annotation-newline (#12203)
This commit is contained in:
parent
a9cd0945b7
commit
7870465b62
@ -0,0 +1,3 @@
|
||||
(
|
||||
{ a, b }: T,
|
||||
): T => {};
|
||||
@ -0,0 +1,104 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":11}},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":11}},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":11}},
|
||||
"expression": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}},
|
||||
"returnType": {
|
||||
"type": "TSTypeAnnotation",
|
||||
"start":18,"end":21,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":4}},
|
||||
"typeAnnotation": {
|
||||
"type": "TSTypeReference",
|
||||
"start":20,"end":21,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4}},
|
||||
"typeName": {
|
||||
"type": "Identifier",
|
||||
"start":20,"end":21,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"T"},
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "ObjectPattern",
|
||||
"start":4,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}},
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectProperty",
|
||||
"start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}},
|
||||
"extra": {
|
||||
"shorthand": true
|
||||
},
|
||||
"method":false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"},
|
||||
"name": "a"
|
||||
},
|
||||
"computed": false,
|
||||
"shorthand": true,
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"},
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ObjectProperty",
|
||||
"start":9,"end":10,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}},
|
||||
"extra": {
|
||||
"shorthand": true
|
||||
},
|
||||
"method": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start":9,"end":10,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"b"},
|
||||
"name": "b"
|
||||
},
|
||||
"computed": false,
|
||||
"shorthand": true,
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start":9,"end":10,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"b"},
|
||||
"name": "b"
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeAnnotation": {
|
||||
"type": "TSTypeAnnotation",
|
||||
"start":12,"end":15,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}},
|
||||
"typeAnnotation": {
|
||||
"type": "TSTypeReference",
|
||||
"start":14,"end":15,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}},
|
||||
"typeName": {
|
||||
"type": "Identifier",
|
||||
"start":14,"end":15,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"T"},
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start":25,"end":27,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":10}},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user