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

426 lines
11 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 21,
"end": 158,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 21,
"end": 89,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 35,
"end": 41,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 35,
"end": 40,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 36,
"end": 40,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 46,
"end": 87,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 46,
"end": 50,
"ctxt": 0
},
"value": "func",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 46,
"end": 87,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 57,
"end": 87,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 67,
"end": 81,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 67,
"end": 80,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 67,
"end": 74,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 69,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
}
}
}
]
},
"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": 90,
"end": 114,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"body": []
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 130,
"end": 134,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 130,
"end": 134,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 131,
"end": 134,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 116,
"end": 158,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 136,
"end": 158,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 142,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 142,
"end": 155,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 142,
"end": 149,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 144,
"end": 149,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 145,
"end": 149,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}