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

653 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 35,
"end": 349,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 35,
"end": 349,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 49,
"end": 59,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 49,
"end": 54,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 54,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 64,
"end": 87,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 71,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 82,
"ctxt": 0
},
"value": "propStatic",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 93,
"end": 347,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 100,
"end": 108,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 100,
"end": 108,
"ctxt": 0
},
"value": "other",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 93,
"end": 347,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 110,
"end": 347,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 120,
"end": 145,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 126,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 126,
"end": 129,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 132,
"end": 144,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 134,
"end": 137,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"value": "other",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 158,
"end": 163,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 173,
"end": 199,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 179,
"end": 198,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 179,
"end": 190,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 181,
"end": 188,
"ctxt": 0
},
"rest": {
"start": 181,
"end": 184,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 193,
"end": 198,
"ctxt": 0
},
"value": "other",
"optional": false
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 219,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 208,
"end": 218,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 213,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 214,
"end": 218,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 229,
"end": 254,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 235,
"end": 253,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 235,
"end": 242,
"ctxt": 0
},
"value": "statics",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 245,
"end": 253,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 247,
"end": 250,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 263,
"end": 282,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 263,
"end": 282,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 263,
"end": 270,
"ctxt": 0
},
"value": "statics",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 271,
"end": 282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 272,
"end": 282,
"ctxt": 0
},
"value": "propStatic",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 291,
"end": 314,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 297,
"end": 313,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 297,
"end": 309,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 299,
"end": 307,
"ctxt": 0
},
"rest": {
"start": 299,
"end": 302,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 302,
"end": 307,
"ctxt": 0
},
"value": "sRest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "C",
"optional": false
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 323,
"end": 341,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 323,
"end": 340,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 323,
"end": 328,
"ctxt": 0
},
"value": "sRest",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 329,
"end": 340,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 330,
"end": 340,
"ctxt": 0
},
"value": "propStatic",
"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": []
}
],
"interpreter": null
}