Skip to content

Commit

Permalink
[ts] Add parser test: destructuring-with-annotation-newline (#12203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mongkii committed Oct 16, 2020
1 parent a9cd094 commit 7870465
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
@@ -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": []
}
}

0 comments on commit 7870465

Please sign in to comment.