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

690 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 66,
"end": 458,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 76,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 66,
"end": 99,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 84,
"end": 96,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 87,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"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": 109,
"end": 116,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 103,
"end": 152,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 137,
"end": 149,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 140,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 142,
"end": 148,
"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": 125,
"end": 129,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 156,
"end": 191,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 171,
"end": 188,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"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": 201,
"end": 202,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 195,
"end": 253,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 220,
"end": 241,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 228,
"end": 231,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 231,
"end": 240,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 233,
"end": 240,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 233,
"end": 240,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 211,
"end": 212,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 263,
"end": 265,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
"start": 257,
"end": 292,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 273,
"end": 288,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"value": 1.0
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 281,
"end": 287,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 283,
"end": 287,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 283,
"end": 287,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"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": 302,
"end": 304,
"ctxt": 0
},
"value": "B2",
"optional": false
},
"declare": false,
"span": {
"start": 296,
"end": 354,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 323,
"end": 342,
"ctxt": 0
},
"key": {
"type": "NumericLiteral",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": 1.0
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 332,
"end": 341,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 334,
"end": 341,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 334,
"end": 341,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 313,
"end": 315,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 364,
"end": 366,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 358,
"end": 394,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 374,
"end": 391,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
"start": 381,
"end": 384,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 384,
"end": 390,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 386,
"end": 390,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 386,
"end": 390,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"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": 404,
"end": 406,
"ctxt": 0
},
"value": "B3",
"optional": false
},
"declare": false,
"span": {
"start": 398,
"end": 458,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 425,
"end": 446,
"ctxt": 0
},
"key": {
"type": "StringLiteral",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 436,
"end": 445,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 438,
"end": 445,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 438,
"end": 445,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 415,
"end": 417,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}