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

469 lines
11 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 112,
"end": 240,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 112,
"end": 123,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 117,
"end": 122,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 125,
"end": 145,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 129,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 133,
"end": 144,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "x",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 134,
"end": 142,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 135,
"end": 141,
"ctxt": 0
},
"kind": "number"
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 147,
"end": 174,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 151,
"end": 173,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 155,
"end": 173,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": "x",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 165,
"end": 172,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 156,
"end": 164,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"kind": "string"
}
]
}
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 178,
"end": 202,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 188,
"end": 200,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 188,
"end": 191,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 191,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 204,
"end": 220,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 208,
"end": 219,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 212,
"end": 219,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "x",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 213,
"end": 216,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 240,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 239,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 230,
"end": 239,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "x",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 231,
"end": 236,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 232,
"end": 235,
"ctxt": 0
},
"kind": "any"
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}