swc/crates/swc_ecma_parser/tests/tsc/privateNameAndObjectRestSpread.json
2022-02-04 17:08:38 +09:00

655 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 34,
"end": 348,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 34,
"end": 348,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 48,
"end": 58,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 48,
"end": 53,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 49,
"end": 53,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"computed": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 63,
"end": 86,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 70,
"end": 81,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 81,
"ctxt": 0
},
"value": "propStatic",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"computed": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 92,
"end": 346,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 99,
"end": 107,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 99,
"end": 107,
"ctxt": 0
},
"value": "other",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 92,
"end": 346,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 109,
"end": 346,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 119,
"end": 144,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 125,
"end": 143,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 125,
"end": 128,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 131,
"end": 143,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 133,
"end": 136,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"value": "other",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 153,
"end": 163,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 153,
"end": 162,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 153,
"end": 156,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 157,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 172,
"end": 198,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 178,
"end": 197,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 178,
"end": 189,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 180,
"end": 187,
"ctxt": 0
},
"rest": {
"start": 180,
"end": 183,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 192,
"end": 197,
"ctxt": 0
},
"value": "other",
"optional": false
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 207,
"end": 218,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 207,
"end": 217,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 207,
"end": 211,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 213,
"end": 217,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 228,
"end": 253,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 234,
"end": 252,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 234,
"end": 241,
"ctxt": 0
},
"value": "statics",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 244,
"end": 252,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 246,
"end": 249,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 262,
"end": 281,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 262,
"end": 281,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"value": "statics",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 270,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 271,
"end": 281,
"ctxt": 0
},
"value": "propStatic",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 290,
"end": 313,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 296,
"end": 312,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 296,
"end": 308,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 298,
"end": 306,
"ctxt": 0
},
"rest": {
"start": 298,
"end": 301,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 301,
"end": 306,
"ctxt": 0
},
"value": "sRest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"value": "C",
"optional": false
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 322,
"end": 340,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 322,
"end": 339,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 322,
"end": 327,
"ctxt": 0
},
"value": "sRest",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 328,
"end": 339,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 329,
"end": 339,
"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
}