swc/crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassLeadingOptional.json
Donny/강동윤 3958f1792c
refactor(es/ast): Remove unused fields (#7518)
**Related issue:**

 - Closes #7347.
 - Closes #7487.
2023-06-12 08:02:34 +00:00

197 lines
5.4 KiB
JSON

{
"type": "Module",
"span": {
"start": 114,
"end": 179,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 114,
"end": 179,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "Z",
"optional": false
},
"declare": false,
"span": {
"start": 121,
"end": 179,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 135,
"end": 177,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "Parameter",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 135,
"end": 177,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 147,
"end": 177,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 157,
"end": 171,
"ctxt": 0
},
"argument": {
"type": "ArrayExpression",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
],
"interpreter": null
}