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

484 lines
15 KiB
JSON

{
"type": "Script",
"span": {
"start": 55,
"end": 373,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 91,
"ctxt": 0
},
"value": "connectionFromArray",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 92,
"end": 107,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 92,
"end": 107,
"ctxt": 0
},
"value": "objects",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 99,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 101,
"end": 107,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 113,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 55,
"end": 124,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"members": []
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 134,
"end": 148,
"ctxt": 0
},
"value": "rootConnection",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 149,
"end": 161,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 149,
"end": 161,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 153,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 155,
"end": 161,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 125,
"end": 349,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 163,
"end": 349,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 167,
"end": 347,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 174,
"end": 346,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 180,
"end": 187,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 189,
"end": 342,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 196,
"end": 203,
"ctxt": 0
},
"value": "context",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 205,
"end": 209,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 214,
"end": 342,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 224,
"end": 266,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 230,
"end": 265,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 230,
"end": 241,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 232,
"end": 239,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 232,
"end": 239,
"ctxt": 0
},
"value": "objects",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 244,
"end": 265,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 250,
"end": 265,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 252,
"end": 259,
"ctxt": 0
},
"value": "objects",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 261,
"end": 263,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
}
}
]
}
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 273,
"end": 336,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 280,
"end": 335,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 290,
"end": 293,
"ctxt": 0
},
"arguments": {
"type": "CallExpression",
"span": {
"start": 293,
"end": 327,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 293,
"end": 312,
"ctxt": 0
},
"value": "connectionFromArray",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 313,
"end": 320,
"ctxt": 0
},
"value": "objects",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 322,
"end": 326,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
}
]
}
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 350,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 350,
"end": 372,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 350,
"end": 364,
"ctxt": 0
},
"value": "rootConnection",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 365,
"end": 371,
"ctxt": 0
},
"value": "test",
"raw": "'test'"
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}