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

803 lines
24 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 566,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1,
"end": 64,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 25,
"ctxt": 0
},
"value": "ContextualType",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 29,
"end": 64,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 35,
"end": 62,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 35,
"end": 41,
"ctxt": 0
},
"value": "method",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 42,
"end": 54,
"ctxt": 0
},
"value": "parameter",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 54,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 61,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 77,
"ctxt": 0
},
"value": "CBase",
"optional": false
},
"declare": false,
"span": {
"start": 66,
"end": 178,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 88,
"end": 133,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 88,
"end": 99,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 100,
"end": 124,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 100,
"end": 124,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 124,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 124,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 121,
"ctxt": 0
},
"value": "ContextualType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 126,
"end": 133,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 139,
"end": 176,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 139,
"end": 142,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 143,
"end": 167,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 143,
"end": 167,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 148,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 150,
"end": 167,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 150,
"end": 164,
"ctxt": 0
},
"value": "ContextualType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 139,
"end": 176,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 176,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 180,
"end": 566,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 216,
"end": 564,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 216,
"end": 227,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 230,
"end": 564,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 309,
"end": 392,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 309,
"end": 391,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 315,
"end": 390,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 329,
"end": 335,
"ctxt": 0
},
"value": "method",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 329,
"end": 380,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 339,
"end": 380,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 357,
"end": 366,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 357,
"end": 365,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": "p",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 359,
"end": 365,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 471,
"end": 558,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 471,
"end": 557,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 471,
"end": 480,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 471,
"end": 476,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 477,
"end": 480,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 481,
"end": 556,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 495,
"end": 501,
"ctxt": 0
},
"value": "method",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 502,
"end": 503,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 502,
"end": 503,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 495,
"end": 546,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 505,
"end": 546,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 523,
"end": 532,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 523,
"end": 531,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 523,
"end": 524,
"ctxt": 0
},
"value": "p",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 525,
"end": 531,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 196,
"end": 201,
"ctxt": 0
},
"value": "CBase",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 201,
"end": 209,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 202,
"end": 208,
"ctxt": 0
},
"kind": "string"
}
]
},
"implements": []
}
],
"interpreter": null
}