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

357 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 32,
"end": 170,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 60,
"ctxt": 0
},
"value": "takeFirstTwoEntries",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 61,
"end": 104,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 61,
"end": 104,
"ctxt": 0
},
"rest": {
"start": 61,
"end": 64,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 64,
"end": 84,
"ctxt": 0
},
"elements": [
{
"type": "ArrayPattern",
"span": {
"start": 65,
"end": 73,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 66,
"end": 68,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 70,
"end": 72,
"ctxt": 0
},
"value": "v1",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
{
"type": "ArrayPattern",
"span": {
"start": 75,
"end": 83,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 80,
"end": 82,
"ctxt": 0
},
"value": "v2",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 86,
"end": 104,
"ctxt": 0
},
"elemType": {
"type": "TsTupleType",
"span": {
"start": 86,
"end": 102,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"kind": "number"
}
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 32,
"end": 109,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 106,
"end": 109,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 110,
"end": 170,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 110,
"end": 169,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 110,
"end": 129,
"ctxt": 0
},
"value": "takeFirstTwoEntries",
"optional": false
},
"arguments": [
{
"spread": {
"start": 130,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 133,
"end": 168,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"value": "Map",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 141,
"end": 167,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 142,
"end": 149,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 143,
"end": 145,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": 0.0
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 151,
"end": 166,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 152,
"end": 159,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
},
"value": true
}
}
]
}
}
]
}
}
],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}