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

897 lines
24 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 303,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 23,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 6,
"end": 22,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 6,
"end": 16,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 10,
"end": 15,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 19,
"end": 22,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 30,
"end": 60,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 36,
"end": 59,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 36,
"end": 53,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"value": "c",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 47,
"end": 52,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "e",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 80,
"end": 117,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 86,
"end": 116,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 86,
"end": 110,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 90,
"end": 95,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "f",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 97,
"end": 102,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "h",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "i",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 104,
"end": 109,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "f",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 113,
"end": 116,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 138,
"end": 177,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 138,
"end": 176,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 138,
"end": 171,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 149,
"end": 159,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ArrayPattern",
"span": {
"start": 149,
"end": 159,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 153,
"end": 158,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 139,
"end": 170,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 161,
"end": 170,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 178,
"end": 237,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 178,
"end": 236,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 178,
"end": 231,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 189,
"end": 206,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ArrayPattern",
"span": {
"start": 189,
"end": 206,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 193,
"end": 198,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "c",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 200,
"end": 205,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "e",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 179,
"end": 230,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 208,
"end": 230,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 232,
"end": 235,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 238,
"end": 303,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 238,
"end": 303,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 238,
"end": 298,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 249,
"end": 273,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ArrayPattern",
"span": {
"start": 249,
"end": 273,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 253,
"end": 258,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"value": "f",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 260,
"end": 265,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "h",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "i",
"optional": false
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "f",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 239,
"end": 297,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 275,
"end": 297,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}