swc/crates/swc_ecma_parser/tests/tsc/privateNamesUnique-2.json

566 lines
14 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 39,
"end": 327,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 39,
"end": 137,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 46,
"end": 137,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 62,
"end": 64,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"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": 70,
"end": 135,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "copy",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 75,
"end": 99,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 75,
"end": 99,
"ctxt": 0
},
"value": "other",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 99,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsImportType",
"span": {
"start": 82,
"end": 99,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 89,
"end": 94,
"ctxt": 0
},
"value": "./b",
"raw": "\"./b\""
},
"qualifier": {
"type": "Identifier",
"span": {
"start": 96,
"end": 99,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeArguments": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 70,
"end": 135,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 101,
"end": 135,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 111,
"end": 120,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 111,
"end": 119,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 111,
"end": 116,
"ctxt": 0
},
"value": "other",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 117,
"end": 119,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"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": "ExportDeclaration",
"span": {
"start": 162,
"end": 190,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 169,
"end": 190,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 185,
"end": 188,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 185,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": null,
"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": "ImportDeclaration",
"span": {
"start": 214,
"end": 245,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 223,
"end": 231,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "A",
"optional": false
},
"imported": {
"type": "Identifier",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 239,
"end": 244,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 246,
"end": 277,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 255,
"end": 263,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "B",
"optional": false
},
"imported": {
"type": "Identifier",
"span": {
"start": 255,
"end": 258,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 271,
"end": 276,
"ctxt": 0
},
"value": "./b",
"raw": "\"./b\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 279,
"end": 297,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 285,
"end": 296,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 289,
"end": 296,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 298,
"end": 316,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 304,
"end": 315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 308,
"end": 315,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 317,
"end": 327,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 317,
"end": 326,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 317,
"end": 323,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 319,
"end": 323,
"ctxt": 0
},
"value": "copy",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 324,
"end": 325,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}