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

690 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 49,
"end": 432,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 55,
"end": 59,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 49,
"end": 82,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 67,
"end": 79,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 70,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 72,
"end": 78,
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 92,
"end": 99,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 86,
"end": 135,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 123,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 108,
"end": 112,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 145,
"end": 146,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 139,
"end": 167,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 171,
"end": 233,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 196,
"end": 210,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"value": "fooo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 200,
"end": 209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 202,
"end": 209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 202,
"end": 209,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 243,
"end": 245,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
"start": 237,
"end": 265,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 253,
"end": 261,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": 1.0
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 254,
"end": 260,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 256,
"end": 260,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 256,
"end": 260,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 275,
"end": 277,
"ctxt": 0
},
"value": "B2",
"optional": false
},
"declare": false,
"span": {
"start": 269,
"end": 330,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 296,
"end": 309,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
"start": 296,
"end": 299,
"ctxt": 0
},
"value": 1.1
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 299,
"end": 308,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 301,
"end": 308,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 301,
"end": 308,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 286,
"end": 288,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 334,
"end": 363,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 350,
"end": 360,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
"start": 350,
"end": 353,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 353,
"end": 359,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 355,
"end": 359,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 355,
"end": 359,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 373,
"end": 375,
"ctxt": 0
},
"value": "B3",
"optional": false
},
"declare": false,
"span": {
"start": 367,
"end": 432,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 394,
"end": 409,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
"start": 394,
"end": 399,
"ctxt": 0
},
"value": "1.1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 399,
"end": 408,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 401,
"end": 408,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 401,
"end": 408,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 384,
"end": 386,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}