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

714 lines
20 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
2022-02-04 14:17:42 +03:00
"end": 247,
"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": 37,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 16,
"end": 37,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 17,
"end": 37,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 19,
"end": 37,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 21,
"end": 28,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 24,
"end": 27,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 29,
"end": 35,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 29,
"end": 32,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 32,
"end": 35,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 0,
2022-02-04 14:17:42 +03:00
"end": 56,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 39,
2022-02-04 14:17:42 +03:00
"end": 56,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 45,
"end": 54,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "x",
"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": {
2022-02-04 14:17:42 +03:00
"start": 58,
"end": 91,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 90,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 66,
"end": 90,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 66,
"end": 69,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 70,
"end": 89,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 77,
"end": 78,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 83,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 87,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 101,
"end": 134,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 133,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 107,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 110,
"end": 133,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 110,
"end": 113,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 114,
"end": 132,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 116,
"end": 119,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 121,
"end": 122,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 127,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 129,
"end": 130,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 149,
"end": 186,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 153,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 153,
"end": 155,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 158,
"end": 185,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 158,
"end": 161,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 162,
"end": 184,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 164,
"end": 167,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 169,
"end": 172,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 174,
"end": 177,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 179,
"end": 182,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 247,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 209,
"end": 246,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 209,
"end": 211,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 246,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 217,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 226,
"end": 245,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 231,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 233,
"end": 234,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 236,
"end": 239,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 241,
"end": 243,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 217,
"end": 225,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 218,
"end": 224,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 218,
"end": 224,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}