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

423 lines
9.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 39,
"end": 126,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 39,
"end": 50,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 43,
"end": 49,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 44,
"end": 49,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 51,
"end": 75,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 68,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 68,
"end": 70,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 77,
"end": 100,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 77,
"end": 99,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 78,
"end": 98,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 78,
"end": 89,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 92,
"end": 94,
"ctxt": 0
},
"properties": [],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 101,
"end": 126,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 101,
"end": 125,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 102,
"end": 124,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ArrayPattern",
"span": {
"start": 102,
"end": 115,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 118,
"end": 124,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ArrayPattern",
"span": {
"start": 118,
"end": 120,
"ctxt": 0
},
"elements": [],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
}
}
],
"interpreter": null
}