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

525 lines
13 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 53,
"end": 290,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 53,
"end": 95,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 67,
"end": 93,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "p",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 67,
"end": 93,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 75,
"end": 93,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 77,
"end": 91,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 84,
"end": 91,
"ctxt": 0
},
"value": "oh no",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"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": 102,
"end": 103,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 96,
"end": 140,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": "yep",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 141,
"end": 247,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 155,
"end": 167,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"value": "_secret",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 165,
"end": 167,
"ctxt": 0
},
"value": 11.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 172,
"end": 203,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "p",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 172,
"end": 203,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 180,
"end": 203,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 182,
"end": 201,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 189,
"end": 201,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 189,
"end": 193,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 194,
"end": 201,
"ctxt": 0
},
"value": "_secret",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 208,
"end": 245,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "p",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 214,
"end": 219,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 214,
"end": 219,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 208,
"end": 245,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 221,
"end": 245,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 223,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 223,
"end": 243,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 223,
"end": 235,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 223,
"end": 227,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 228,
"end": 235,
"ctxt": 0
},
"value": "_secret",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 238,
"end": 243,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"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": 254,
"end": 255,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 248,
"end": 290,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 272,
"end": 279,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 276,
"end": 279,
"ctxt": 0
},
"value": 101.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "C",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}