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

684 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 47,
"end": 400,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 57,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 47,
"end": 78,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 64,
"end": 76,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 64,
"end": 67,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 67,
"end": 75,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 69,
"end": 75,
"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": {
2022-02-04 14:17:42 +03:00
"start": 86,
"end": 93,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 127,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 113,
"end": 125,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 113,
"end": 116,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 116,
"end": 124,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 118,
"end": 124,
"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": {
2022-02-04 14:17:42 +03:00
"start": 102,
"end": 106,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 129,
"end": 155,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 143,
"end": 153,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 143,
"end": 146,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 146,
"end": 152,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 152,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 152,
"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": {
2022-02-04 14:17:42 +03:00
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 157,
"end": 217,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 195,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 185,
"ctxt": 0
},
"value": "fooo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 185,
"end": 194,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 194,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 194,
"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": {
2022-02-04 14:17:42 +03:00
"start": 173,
"end": 174,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 225,
"end": 227,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 219,
"end": 245,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 242,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 235,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 235,
"end": 241,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 241,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 241,
"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": {
2022-02-04 14:17:42 +03:00
"start": 253,
"end": 255,
"ctxt": 0
},
"value": "B2",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 247,
"end": 306,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 273,
"end": 286,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 273,
"end": 276,
"ctxt": 0
},
"value": 1.1,
"raw": "1.1"
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 276,
"end": 285,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 278,
"end": 285,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 278,
"end": 285,
"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": {
2022-02-04 14:17:42 +03:00
"start": 264,
"end": 266,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 314,
"end": 316,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 308,
"end": 335,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 323,
"end": 333,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 323,
"end": 326,
"ctxt": 0
},
"value": "1",
"raw": "'1'"
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 326,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 328,
"end": 332,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 328,
"end": 332,
"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": {
2022-02-04 14:17:42 +03:00
"start": 343,
"end": 345,
"ctxt": 0
},
"value": "B3",
"optional": false
},
"declare": false,
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 400,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
2022-02-04 14:17:42 +03:00
"start": 363,
"end": 378,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 363,
"end": 368,
"ctxt": 0
},
"value": "1.1",
"raw": "'1.1'"
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 368,
"end": 377,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 370,
"end": 377,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 370,
"end": 377,
"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": {
2022-02-04 14:17:42 +03:00
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}