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

673 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 20,
"end": 294,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 76,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 34,
"end": 51,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 34,
"end": 38,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 35,
"end": 38,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "MemberExpression",
"span": {
"start": 41,
"end": 50,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 46,
"end": 50,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"value": "bar",
"optional": false
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 65,
"end": 69,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": 3.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 84,
"end": 86,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
"start": 78,
"end": 151,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 93,
"end": 112,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 93,
"end": 97,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "CallExpression",
"span": {
"start": 100,
"end": 111,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 100,
"end": 109,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 105,
"end": 109,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 106,
"end": 109,
"ctxt": 0
},
"value": "bar",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateMethod",
"span": {
"start": 129,
"end": 148,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 130,
"end": 133,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 129,
"end": 148,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 136,
"end": 148,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 138,
"end": 146,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 145,
"end": 146,
"ctxt": 0
},
"value": 3.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 159,
"end": 161,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 153,
"end": 228,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 168,
"end": 185,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 168,
"end": 172,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 169,
"end": 172,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "MemberExpression",
"span": {
"start": 175,
"end": 184,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 175,
"end": 179,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"value": "bar",
"optional": false
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateMethod",
"span": {
"start": 202,
"end": 225,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 206,
"end": 210,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 207,
"end": 210,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 202,
"end": 225,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 213,
"end": 225,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 215,
"end": 223,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": 3.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 230,
"end": 294,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 244,
"end": 261,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 244,
"end": 248,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 245,
"end": 248,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "MemberExpression",
"span": {
"start": 251,
"end": 260,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 251,
"end": 255,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 256,
"end": 260,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 257,
"end": 260,
"ctxt": 0
},
"value": "bar",
"optional": false
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 275,
"end": 292,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 275,
"end": 279,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 276,
"end": 279,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"value": {
"type": "MemberExpression",
"span": {
"start": 282,
"end": 291,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 282,
"end": 286,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 287,
"end": 291,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 288,
"end": 291,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}