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

294 lines
8.4 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 128,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 25,
"end": 44,
"ctxt": 0
},
"value": "takeFirstTwoEntries",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 45,
"end": 68,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 45,
"end": 68,
"ctxt": 0
},
"rest": {
"start": 45,
"end": 48,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 48,
"end": 68,
"ctxt": 0
},
"elements": [
{
"type": "ArrayPattern",
"span": {
"start": 49,
"end": 57,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 50,
"end": 52,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 54,
"end": 56,
"ctxt": 0
},
"value": "v1",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
{
"type": "ArrayPattern",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 60,
"end": 62,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"value": "v2",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 16,
"end": 73,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 70,
"end": 73,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 74,
"end": 128,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 74,
"end": 127,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 74,
"end": 93,
"ctxt": 0
},
"value": "takeFirstTwoEntries",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 94,
"end": 126,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"value": "Map",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 102,
"end": 125,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 103,
"end": 110,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 112,
"end": 124,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 113,
"end": 120,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
}
}
]
}
}
],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}