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

441 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 207,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 24,
"end": 25,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 18,
"end": 28,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "EmptyStatement",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 31,
"end": 176,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 45,
"end": 48,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 45,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 53,
"end": 174,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 53,
"end": 174,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 174,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 70,
"end": 88,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 80,
"end": 87,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 97,
"end": 102,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 97,
"end": 101,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 99,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 121,
"end": 142,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 127,
"end": 141,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "D",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 134,
"end": 141,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 151,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 151,
"end": 155,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 153,
"end": 155,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "x",
"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": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 177,
"end": 207,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 189,
"end": 207,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 195,
"end": 205,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 201,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"value": "D",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
],
"interpreter": null
}