swc/crates/swc_ecma_parser/tests/tsc/restElementWithAssignmentPattern5.json
2022-03-22 07:54:08 +00:00

211 lines
4.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 51,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 26,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 13,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 5,
"end": 13,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 7,
"end": 13,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 15,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 15,
"end": 17,
"ctxt": 0
},
"value": "s2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 27,
"end": 51,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 27,
"end": 50,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ArrayPattern",
"span": {
"start": 27,
"end": 39,
"ctxt": 0
},
"elements": [
{
"type": "RestElement",
"span": {
"start": 31,
"end": 38,
"ctxt": 0
},
"rest": {
"start": 28,
"end": 31,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 31,
"end": 38,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 35,
"end": 37,
"ctxt": 0
},
"value": "s2",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 42,
"end": 50,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 43,
"end": 45,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 47,
"end": 49,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
}
],
"interpreter": null
}