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

947 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 109,
"end": 865,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 109,
"end": 131,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 113,
"end": 130,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 113,
"end": 118,
"ctxt": 0
},
"value": "trace",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 118,
"end": 125,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 120,
"end": 125,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"kind": "any"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 128,
"end": 130,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 132,
"end": 175,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 136,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"value": "order",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 144,
"end": 174,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 145,
"end": 151,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 148,
"end": 151,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"body": {
"type": "CallExpression",
"span": {
"start": 161,
"end": 174,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 161,
"end": 171,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 161,
"end": 166,
"ctxt": 0
},
"value": "trace",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 167,
"end": 171,
"ctxt": 0
},
"value": "push",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "n",
"optional": false
}
}
],
"typeArguments": null
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"kind": "any"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 260,
"end": 300,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 264,
"end": 299,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 264,
"end": 294,
"ctxt": 0
},
"elements": [
{
"type": "AssignmentPattern",
"span": {
"start": 265,
"end": 293,
"ctxt": 0
},
"left": {
"type": "ObjectPattern",
"span": {
"start": 265,
"end": 282,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Computed",
"span": {
"start": 267,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 268,
"end": 276,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 268,
"end": 273,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
},
"value": {
"type": "Identifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 285,
"end": 293,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 285,
"end": 290,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 297,
"end": 299,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 371,
"end": 413,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 375,
"end": 412,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 375,
"end": 405,
"ctxt": 0
},
"elements": [
{
"type": "AssignmentPattern",
"span": {
"start": 376,
"end": 404,
"ctxt": 0
},
"left": {
"type": "ObjectPattern",
"span": {
"start": 376,
"end": 393,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Computed",
"span": {
"start": 378,
"end": 388,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 379,
"end": 387,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 379,
"end": 384,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
},
"value": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 396,
"end": 404,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 396,
"end": 401,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 408,
"end": 412,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 409,
"end": 411,
"ctxt": 0
},
"properties": []
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 647,
"end": 714,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 651,
"end": 713,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 651,
"end": 701,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Computed",
"span": {
"start": 653,
"end": 663,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 654,
"end": 662,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 654,
"end": 659,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 660,
"end": 661,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
}
},
"value": {
"type": "AssignmentPattern",
"span": {
"start": 665,
"end": 693,
"ctxt": 0
},
"left": {
"type": "ObjectPattern",
"span": {
"start": 665,
"end": 682,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Computed",
"span": {
"start": 667,
"end": 677,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 668,
"end": 676,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 668,
"end": 673,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 674,
"end": 675,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
],
"typeArguments": null
}
},
"value": {
"type": "Identifier",
"span": {
"start": 679,
"end": 680,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 685,
"end": 693,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 685,
"end": 690,
"ctxt": 0
},
"value": "order",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 691,
"end": 692,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
},
"typeAnnotation": null
}
},
{
"type": "RestElement",
"span": {
"start": 695,
"end": 699,
"ctxt": 0
},
"rest": {
"start": 695,
"end": 698,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 698,
"end": 699,
"ctxt": 0
},
"value": "w",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TsAsExpression",
"span": {
"start": 704,
"end": 713,
"ctxt": 0
},
"expression": {
"type": "ObjectExpression",
"span": {
"start": 704,
"end": 706,
"ctxt": 0
},
"properties": []
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 710,
"end": 713,
"ctxt": 0
},
"kind": "any"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 824,
"end": 865,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 828,
"end": 865,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 828,
"end": 845,
"ctxt": 0
},
"elements": [
{
"type": "ObjectPattern",
"span": {
"start": 829,
"end": 837,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 831,
"end": 835,
"ctxt": 0
},
"rest": {
"start": 831,
"end": 834,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 834,
"end": 835,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 839,
"end": 844,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 839,
"end": 840,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 843,
"end": 844,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 845,
"end": 852,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 847,
"end": 852,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 847,
"end": 850,
"ctxt": 0
},
"kind": "any"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 855,
"end": 865,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 856,
"end": 864,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 858,
"end": 859,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 861,
"end": 862,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}