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

441 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 2,
"end": 281,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 2,
"end": 78,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 24,
"end": 76,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 24,
"end": 35,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 36,
"end": 66,
"ctxt": 0
},
"decorators": [],
"accessibility": "private",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 44,
"end": 66,
"ctxt": 0
},
"value": "map",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 47,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 49,
"end": 66,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 59,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 61,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"typeParams": null
}
}
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 68,
"end": 76,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 9,
"end": 17,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 10,
"end": 12,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 10,
"end": 12,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 14,
"end": 16,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 14,
"end": 16,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 80,
"end": 281,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 215,
"end": 279,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 215,
"end": 226,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 229,
"end": 279,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 231,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 231,
"end": 276,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 231,
"end": 236,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 237,
"end": 275,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 237,
"end": 242,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "CallExpression",
"span": {
"start": 246,
"end": 275,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 246,
"end": 252,
"ctxt": 0
},
"value": "String",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 253,
"end": 274,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 253,
"end": 272,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 253,
"end": 258,
"ctxt": 0
},
"value": "value",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 259,
"end": 272,
"ctxt": 0
},
"value": "toExponential",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 97,
"end": 113,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 98,
"end": 104,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 106,
"end": 112,
"ctxt": 0
},
"kind": "string"
}
]
},
"implements": []
}
],
"interpreter": null
}