swc/crates/swc_ecma_parser/tests/tsc/override19.json
2022-02-04 17:08:38 +09:00

846 lines
22 KiB
JSON

{
"type": "Script",
"span": {
"start": 49,
"end": 476,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 49,
"end": 94,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsConstructorType",
"span": {
"start": 60,
"end": 93,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 73,
"end": 85,
"ctxt": 0
},
"rest": {
"start": 73,
"end": 76,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 76,
"end": 80,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"kind": "any"
}
},
"isAbstract": true
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 112,
"end": 123,
"ctxt": 0
},
"value": "CreateMixin",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"value": "Context",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 166,
"end": 173,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 166,
"end": 173,
"ctxt": 0
},
"value": "Base",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 170,
"end": 173,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 95,
"end": 237,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 123,
"end": 153,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 124,
"end": 137,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": "C",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 139,
"end": 152,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 174,
"end": 237,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 176,
"end": 237,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeLiteral",
"span": {
"start": 180,
"end": 237,
"ctxt": 0
},
"members": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 185,
"end": 235,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 190,
"end": 204,
"ctxt": 0
},
"rest": {
"start": 190,
"end": 193,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 193,
"end": 197,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 197,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 199,
"end": 204,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 205,
"end": 235,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 207,
"end": 235,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 209,
"end": 233,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 209,
"end": 216,
"ctxt": 0
},
"value": "context",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 216,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 218,
"end": 233,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 218,
"end": 230,
"ctxt": 0
},
"value": "InstanceType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 230,
"end": 233,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
]
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 244,
"end": 251,
"ctxt": 0
},
"value": "Context",
"optional": false
},
"declare": false,
"span": {
"start": 238,
"end": 254,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 256,
"end": 288,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 270,
"end": 286,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 270,
"end": 281,
"ctxt": 0
},
"value": "doSomething",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 270,
"end": 286,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 284,
"end": 286,
"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": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 290,
"end": 373,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 335,
"end": 352,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 344,
"end": 347,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 335,
"end": 352,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 350,
"end": 352,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": true
}
],
"superClass": {
"type": "CallExpression",
"span": {
"start": 306,
"end": 329,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 306,
"end": 317,
"ctxt": 0
},
"value": "CreateMixin",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 318,
"end": 325,
"ctxt": 0
},
"value": "Context",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 327,
"end": 328,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
],
"typeArguments": null
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 375,
"end": 476,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 421,
"end": 446,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 430,
"end": 441,
"ctxt": 0
},
"value": "doSomethang",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 421,
"end": 446,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 444,
"end": 446,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": true
}
],
"superClass": {
"type": "CallExpression",
"span": {
"start": 391,
"end": 414,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 391,
"end": 402,
"ctxt": 0
},
"value": "CreateMixin",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 403,
"end": 410,
"ctxt": 0
},
"value": "Context",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 412,
"end": 413,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
],
"typeArguments": null
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}