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

493 lines
14 KiB
JSON

{
"type": "Script",
"span": {
"start": 21,
"end": 226,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 21,
"end": 51,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 33,
"end": 51,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 39,
"end": 49,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 40,
"end": 48,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 42,
"end": 48,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 52,
"end": 195,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 66,
"end": 68,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"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": 74,
"end": 193,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"value": "test",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 74,
"end": 193,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 88,
"end": 193,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 98,
"end": 114,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 98,
"end": 113,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 98,
"end": 108,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 98,
"end": 105,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "PrivateName",
"span": {
"start": 106,
"end": 108,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 123,
"end": 141,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 129,
"end": 140,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 133,
"end": 140,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 150,
"end": 168,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 156,
"end": 167,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 160,
"end": 167,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": "y",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 177,
"end": 187,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 177,
"end": 186,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 180,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "z",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 183,
"end": 186,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 196,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 208,
"end": 226,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 214,
"end": 224,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "D",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
],
"interpreter": null
}