swc/crates/swc_ecma_parser/tests/tsc/restElementWithBindingPattern2.json

147 lines
3.8 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 29,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 29,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 28,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 4,
"end": 19,
"ctxt": 0
},
"elements": [
{
"type": "RestElement",
"span": {
"start": 5,
"end": 18,
"ctxt": 0
},
"rest": {
"start": 5,
"end": 8,
"ctxt": 0
},
"argument": {
"type": "ObjectPattern",
"span": {
"start": 8,
"end": 18,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "NumericLiteral",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": 0.0
},
"value": {
"type": "Identifier",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 22,
"end": 28,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": 0.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}