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

514 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 231,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 231,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 15,
"end": 61,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 15,
"end": 61,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 28,
"end": 61,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 38,
"end": 55,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 38,
"end": 55,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 38,
"end": 43,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 40,
"end": 43,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 46,
"end": 55,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 67,
"end": 229,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 78,
"end": 87,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 78,
"end": 87,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 87,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 81,
"end": 87,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 67,
"end": 229,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 97,
"end": 229,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 107,
"end": 124,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 107,
"end": 124,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 107,
"end": 112,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 109,
"end": 112,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 115,
"end": 124,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 142,
"end": 159,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 142,
"end": 158,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 142,
"end": 147,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 150,
"end": 158,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 174,
"end": 199,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 174,
"end": 198,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 174,
"end": 179,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 182,
"end": 198,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 183,
"end": 192,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 184,
"end": 192,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 186,
"end": 192,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "NumericLiteral",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "ReturnStatement",
"span": {
"start": 214,
"end": 223,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 96,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 96,
"ctxt": 0
},
"kind": "number"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}