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

361 lines
9.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 163,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 24,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 89,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 31,
"end": 87,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 31,
"end": 51,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 32,
"end": 50,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 32,
"end": 38,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 39,
"end": 50,
"ctxt": 0
},
"value": "toStringTag",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 31,
"end": 87,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 54,
"end": 87,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 64,
"end": 81,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 71,
"end": 80,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
]
},
"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": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 97,
"end": 99,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"declare": false,
"span": {
"start": 91,
"end": 114,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 116,
"end": 126,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 120,
"end": 125,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 125,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 123,
"end": 125,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 123,
"end": 125,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 127,
"end": 163,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 131,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 131,
"end": 134,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 162,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 137,
"end": 160,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 158,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 138,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 139,
"end": 157,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 139,
"end": 145,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 146,
"end": 157,
"ctxt": 0
},
"value": "toStringTag",
"optional": false
}
}
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}