mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
357 lines
10 KiB
JSON
357 lines
10 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 16,
|
|
"end": 157,
|
|
"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": 88,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "RestElement",
|
|
"span": {
|
|
"start": 45,
|
|
"end": 88,
|
|
"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": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 68,
|
|
"end": 88,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsArrayType",
|
|
"span": {
|
|
"start": 70,
|
|
"end": 88,
|
|
"ctxt": 0
|
|
},
|
|
"elemType": {
|
|
"type": "TsTupleType",
|
|
"span": {
|
|
"start": 70,
|
|
"end": 86,
|
|
"ctxt": 0
|
|
},
|
|
"elemTypes": [
|
|
{
|
|
"type": "TsTupleElement",
|
|
"span": {
|
|
"start": 71,
|
|
"end": 77,
|
|
"ctxt": 0
|
|
},
|
|
"label": null,
|
|
"ty": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 71,
|
|
"end": 77,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
{
|
|
"type": "TsTupleElement",
|
|
"span": {
|
|
"start": 79,
|
|
"end": 85,
|
|
"ctxt": 0
|
|
},
|
|
"label": null,
|
|
"ty": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 79,
|
|
"end": 85,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "number"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 16,
|
|
"end": 93,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 90,
|
|
"end": 93,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": []
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 157,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 156,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 113,
|
|
"ctxt": 0
|
|
},
|
|
"value": "takeFirstTwoEntries",
|
|
"optional": false
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": {
|
|
"start": 114,
|
|
"end": 117,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "NewExpression",
|
|
"span": {
|
|
"start": 117,
|
|
"end": 155,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 121,
|
|
"end": 124,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Map",
|
|
"optional": false
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 125,
|
|
"end": 154,
|
|
"ctxt": 0
|
|
},
|
|
"elements": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 126,
|
|
"end": 136,
|
|
"ctxt": 0
|
|
},
|
|
"elements": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 127,
|
|
"end": 129,
|
|
"ctxt": 0
|
|
},
|
|
"value": "",
|
|
"raw": "\"\""
|
|
}
|
|
},
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 131,
|
|
"end": 135,
|
|
"ctxt": 0
|
|
},
|
|
"value": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "ArrayExpression",
|
|
"span": {
|
|
"start": 138,
|
|
"end": 153,
|
|
"ctxt": 0
|
|
},
|
|
"elements": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 139,
|
|
"end": 146,
|
|
"ctxt": 0
|
|
},
|
|
"value": "hello",
|
|
"raw": "\"hello\""
|
|
}
|
|
},
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 148,
|
|
"end": 152,
|
|
"ctxt": 0
|
|
},
|
|
"value": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|