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

966 lines
24 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 324,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 16,
"end": 20,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 16,
"end": 20,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 17,
"end": 20,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 0,
"end": 39,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 22,
"end": 39,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 28,
"end": 37,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": "t",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 12,
"end": 15,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 41,
"end": 61,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 45,
"end": 60,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 49,
"end": 60,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 49,
"end": 52,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 53,
"end": 59,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 74,
"end": 104,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 78,
"end": 103,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 82,
"end": 103,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 96,
"end": 102,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 85,
"end": 95,
"ctxt": 0
},
"params": [
{
"type": "TsArrayType",
"span": {
"start": 86,
"end": 94,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"kind": "number"
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 117,
"end": 145,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 121,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"value": "ra",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 126,
"end": 144,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 126,
"end": 129,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"params": [
{
"type": "TsArrayType",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 130,
"end": 133,
"ctxt": 0
},
"kind": "any"
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 155,
"end": 172,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 159,
"end": 171,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 161,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 164,
"end": 171,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 168,
"end": 170,
"ctxt": 0
},
"elements": []
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 182,
"end": 209,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 186,
"end": 208,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 188,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 191,
"end": 208,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 191,
"end": 194,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 205,
"end": 207,
"ctxt": 0
},
"elements": []
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 194,
"end": 204,
"ctxt": 0
},
"params": [
{
"type": "TsArrayType",
"span": {
"start": 195,
"end": 203,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"kind": "number"
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 244,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 243,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 231,
"end": 243,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 231,
"end": 234,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 235,
"end": 242,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 239,
"end": 241,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 253,
"end": 282,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 257,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 257,
"end": 259,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 262,
"end": 281,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 262,
"end": 265,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 273,
"end": 280,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 277,
"end": 279,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 265,
"end": 272,
"ctxt": 0
},
"params": [
{
"type": "TsArrayType",
"span": {
"start": 266,
"end": 271,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 266,
"end": 269,
"ctxt": 0
},
"kind": "any"
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 292,
"end": 324,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 296,
"end": 323,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 296,
"end": 298,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 301,
"end": 323,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 301,
"end": 304,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 315,
"end": 322,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 319,
"end": 321,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 304,
"end": 314,
"ctxt": 0
},
"params": [
{
"type": "TsArrayType",
"span": {
"start": 305,
"end": 313,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}