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

211 lines
4.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 52,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 27,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 6,
"end": 14,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 8,
"end": 14,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 16,
"end": 26,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 16,
"end": 18,
"ctxt": 0
},
"value": "s2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 18,
"end": 26,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 20,
"end": 26,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 28,
"end": 52,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 28,
"end": 51,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ArrayPattern",
"span": {
"start": 28,
"end": 40,
"ctxt": 0
},
"elements": [
{
"type": "RestElement",
"span": {
"start": 32,
"end": 39,
"ctxt": 0
},
"rest": {
"start": 29,
"end": 32,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 32,
"end": 39,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 36,
"end": 38,
"ctxt": 0
},
"value": "s2",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 43,
"end": 51,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 44,
"end": 46,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
}
],
"interpreter": null
}