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

385 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 61,
"end": 142,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 61,
"end": 116,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 65,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 66,
"end": 71,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 68,
"end": 71,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 74,
"end": 79,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 81,
"end": 107,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 82,
"end": 87,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 90,
"end": 107,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 94,
"end": 106,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
}
}
]
},
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 109,
"end": 115,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 115,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 115,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 117,
"end": 142,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 117,
"end": 141,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 118,
"end": 140,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 118,
"end": 136,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "AssignmentPattern",
"span": {
"start": 122,
"end": 135,
"ctxt": 0
},
"left": {
"type": "ObjectPattern",
"span": {
"start": 122,
"end": 131,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null
},
{
"type": "RestElement",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"rest": {
"start": 126,
"end": 129,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "d",
"optional": false
},
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
}
}
],
"interpreter": null
}