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

1331 lines
39 KiB
JSON

{
"type": "Script",
"span": {
"start": 164,
"end": 1384,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 164,
"end": 226,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 168,
"end": 226,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 168,
"end": 176,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"value": "a1",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 173,
"end": 175,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 173,
"end": 175,
"ctxt": 0
},
"value": "a2",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 176,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 178,
"end": 204,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 180,
"end": 191,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 180,
"end": 182,
"ctxt": 0
},
"value": "a1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 182,
"end": 190,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 184,
"end": 190,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 192,
"end": 202,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 192,
"end": 194,
"ctxt": 0
},
"value": "a2",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 202,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 207,
"end": 226,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 209,
"end": 211,
"ctxt": 0
},
"value": "a1",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 213,
"end": 217,
"ctxt": 0
},
"value": true
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 219,
"end": 221,
"ctxt": 0
},
"value": "a2",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 250,
"end": 325,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 254,
"end": 324,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 254,
"end": 270,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 255,
"end": 257,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
{
"type": "ArrayPattern",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"elements": [
{
"type": "ArrayPattern",
"span": {
"start": 260,
"end": 264,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 261,
"end": 263,
"ctxt": 0
},
"value": "a4",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": "a5",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 270,
"end": 301,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 272,
"end": 301,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 273,
"end": 279,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 273,
"end": 279,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 281,
"end": 291,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTupleType",
"span": {
"start": 281,
"end": 291,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 282,
"end": 290,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTupleType",
"span": {
"start": 282,
"end": 290,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 283,
"end": 289,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 283,
"end": 289,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
]
}
},
{
"type": "TsTupleElement",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"kind": "boolean"
}
}
]
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 304,
"end": 324,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 305,
"end": 306,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 308,
"end": 317,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 309,
"end": 316,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 310,
"end": 315,
"ctxt": 0
},
"value": false
}
}
]
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 319,
"end": 323,
"ctxt": 0
},
"value": true
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 550,
"end": 587,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 554,
"end": 586,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 554,
"end": 558,
"ctxt": 0
},
"value": "temp",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 561,
"end": 586,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 563,
"end": 565,
"ctxt": 0
},
"value": "t1",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 567,
"end": 571,
"ctxt": 0
},
"value": true
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 573,
"end": 575,
"ctxt": 0
},
"value": "t2",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 577,
"end": 584,
"ctxt": 0
},
"value": "false",
"raw": "\"false\""
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 588,
"end": 657,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 592,
"end": 656,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 592,
"end": 622,
"ctxt": 0
},
"elements": [
{
"type": "AssignmentPattern",
"span": {
"start": 593,
"end": 599,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 593,
"end": 595,
"ctxt": 0
},
"value": "b0",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 598,
"end": 599,
"ctxt": 0
},
"value": 3.0
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 601,
"end": 610,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 601,
"end": 603,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 606,
"end": 610,
"ctxt": 0
},
"value": true
},
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 612,
"end": 621,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 612,
"end": 614,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 617,
"end": 621,
"ctxt": 0
},
"value": "temp",
"optional": false
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 625,
"end": 656,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 626,
"end": 627,
"ctxt": 0
},
"value": 3.0
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 629,
"end": 634,
"ctxt": 0
},
"value": false
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 636,
"end": 655,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 638,
"end": 640,
"ctxt": 0
},
"value": "t1",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 642,
"end": 647,
"ctxt": 0
},
"value": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 649,
"end": 651,
"ctxt": 0
},
"value": "t2",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 653,
"end": 654,
"ctxt": 0
},
"value": 5.0
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 905,
"end": 970,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 909,
"end": 969,
"ctxt": 0
},
"id": {
"type": "ArrayPattern",
"span": {
"start": 909,
"end": 942,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 910,
"end": 912,
"ctxt": 0
},
"value": "c1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 914,
"end": 916,
"ctxt": 0
},
"value": "c2",
"optional": false,
"typeAnnotation": null
},
{
"type": "ObjectPattern",
"span": {
"start": 918,
"end": 932,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 920,
"end": 922,
"ctxt": 0
},
"value": "c3",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 924,
"end": 926,
"ctxt": 0
},
"value": "c4",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 928,
"end": 930,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 928,
"end": 930,
"ctxt": 0
},
"value": "c5",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
null,
{
"type": "RestElement",
"span": {
"start": 936,
"end": 941,
"ctxt": 0
},
"rest": {
"start": 936,
"end": 939,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 939,
"end": 941,
"ctxt": 0
},
"value": "c6",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 945,
"end": 969,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 946,
"end": 947,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 949,
"end": 950,
"ctxt": 0
},
"value": 2.0
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 952,
"end": 968,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 954,
"end": 956,
"ctxt": 0
},
"value": "c3",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 958,
"end": 959,
"ctxt": 0
},
"value": 4.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 961,
"end": 963,
"ctxt": 0
},
"value": "c5",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 965,
"end": 966,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1302,
"end": 1384,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1306,
"end": 1383,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 1306,
"end": 1334,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1307,
"end": 1308,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "ObjectPattern",
"span": {
"start": 1310,
"end": 1333,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 1311,
"end": 1332,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1311,
"end": 1313,
"ctxt": 0
},
"value": "d1",
"optional": false
},
"value": {
"type": "ArrayExpression",
"span": {
"start": 1316,
"end": 1332,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 1317,
"end": 1325,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
},
{
"spread": null,
"expression": {
"type": "NullLiteral",
"span": {
"start": 1327,
"end": 1331,
"ctxt": 0
}
}
}
]
}
}
],
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1334,
"end": 1359,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1336,
"end": 1359,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1338,
"end": 1357,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1338,
"end": 1339,
"ctxt": 0
},
"value": "d",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1339,
"end": 1357,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1341,
"end": 1357,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1343,
"end": 1355,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1343,
"end": 1345,
"ctxt": 0
},
"value": "d1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1345,
"end": 1355,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 1347,
"end": 1355,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1347,
"end": 1353,
"ctxt": 0
},
"kind": "number"
}
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 1362,
"end": 1383,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1364,
"end": 1365,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 1367,
"end": 1381,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1369,
"end": 1371,
"ctxt": 0
},
"value": "d1",
"optional": false
},
"value": {
"type": "ArrayExpression",
"span": {
"start": 1373,
"end": 1379,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1374,
"end": 1375,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1377,
"end": 1378,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
]
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}