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

367 lines
8.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 169,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 24,
"end": 25,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 18,
"end": 67,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 32,
"end": 65,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 32,
"end": 65,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 40,
"end": 65,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"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": 75,
"end": 76,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 69,
"end": 101,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 83,
"end": 99,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 83,
"end": 99,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 92,
"end": 99,
"ctxt": 0
},
"stmts": []
},
"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": "VariableDeclaration",
"span": {
"start": 103,
"end": 139,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 107,
"end": 139,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 111,
"end": 139,
"ctxt": 0
},
"properties": [
{
"type": "GetterProperty",
"span": {
"start": 117,
"end": 137,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeAnnotation": null,
"body": {
"type": "BlockStatement",
"span": {
"start": 125,
"end": 137,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 127,
"end": 135,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 141,
"end": 169,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 145,
"end": 169,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 145,
"end": 146,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 149,
"end": 169,
"ctxt": 0
},
"properties": [
{
"type": "SetterProperty",
"span": {
"start": 155,
"end": 167,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "b",
"optional": false
},
"param": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"stmts": []
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}