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

302 lines
8.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 57,
"end": 178,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 57,
"end": 70,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 57,
"end": 69,
"ctxt": 0
},
"value": "use strict",
"raw": "\"use strict\""
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 71,
"end": 83,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 77,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 84,
"end": 178,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 98,
"end": 109,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 104,
"end": 108,
"ctxt": 0
},
"value": true
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 114,
"end": 176,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 125,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 128,
"end": 176,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 138,
"end": 170,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 144,
"end": 169,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 155,
"end": 169,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}