swc/crates/swc_estree_compat/tests/fixtures/class-getter-setter/output.json
Donny/강동윤 790a262c07
refactor(es/estree): Rename: babel => estree (#2846)
swc_babel_ast:
 - Rename as `swc_estree_ast`.

swc_babel_compat:
 - Rename as `swc_estree_compat`.

swc_babel_visit:
 - Rename as `swc_estree_visit`.
2021-11-24 05:34:41 +09:00

1290 lines
38 KiB
JSON

{
"type": "File",
"start": 0,
"end": 400,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 23,
"column": 0
}
},
"errors": [],
"program": {
"type": "Program",
"start": 0,
"end": 400,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 23,
"column": 0
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start": 0,
"end": 333,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 18,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 15
},
"identifierName": "Rectangle"
},
"name": "Rectangle"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 16,
"end": 333,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 18,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 22,
"end": 114,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 5,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 22,
"end": 33,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"computed": false,
"kind": "constructor",
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 34,
"end": 40,
"loc": {
"start": {
"line": 2,
"column": 16
},
"end": {
"line": 2,
"column": 22
},
"identifierName": "height"
},
"name": "height"
},
{
"type": "Identifier",
"start": 42,
"end": 47,
"loc": {
"start": {
"line": 2,
"column": 24
},
"end": {
"line": 2,
"column": 29
},
"identifierName": "width"
},
"name": "width"
}
],
"body": {
"type": "BlockStatement",
"start": 49,
"end": 114,
"loc": {
"start": {
"line": 2,
"column": 31
},
"end": {
"line": 5,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 59,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 59,
"end": 79,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 59,
"end": 70,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 59,
"end": 63,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 12
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 64,
"end": 70,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 19
},
"identifierName": "height"
},
"name": "height"
}
},
"right": {
"type": "Identifier",
"start": 73,
"end": 79,
"loc": {
"start": {
"line": 3,
"column": 22
},
"end": {
"line": 3,
"column": 28
},
"identifierName": "height"
},
"name": "height"
}
}
},
{
"type": "ExpressionStatement",
"start": 89,
"end": 108,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 89,
"end": 107,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 89,
"end": 99,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 89,
"end": 93,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 12
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 94,
"end": 99,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 18
},
"identifierName": "width"
},
"name": "width"
}
},
"right": {
"type": "Identifier",
"start": 102,
"end": 107,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 26
},
"identifierName": "width"
},
"name": "width"
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 120,
"end": 164,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 48
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 124,
"end": 130,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 14
},
"identifierName": "height"
},
"name": "height"
},
"computed": false,
"kind": "set",
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 131,
"end": 137,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 7,
"column": 21
},
"identifierName": "height"
},
"name": "height"
}
],
"body": {
"type": "BlockStatement",
"start": 139,
"end": 164,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 48
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 141,
"end": 162,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 46
}
},
"expression": {
"type": "AssignmentExpression",
"start": 141,
"end": 161,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 45
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 141,
"end": 152,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 36
}
},
"object": {
"type": "ThisExpression",
"start": 141,
"end": 145,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 29
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 146,
"end": 152,
"loc": {
"start": {
"line": 7,
"column": 30
},
"end": {
"line": 7,
"column": 36
},
"identifierName": "height"
},
"name": "height"
}
},
"right": {
"type": "Identifier",
"start": 155,
"end": 161,
"loc": {
"start": {
"line": 7,
"column": 39
},
"end": {
"line": 7,
"column": 45
},
"identifierName": "height"
},
"name": "height"
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 170,
"end": 210,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 44
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 174,
"end": 179,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 13
},
"identifierName": "width"
},
"name": "width"
},
"computed": false,
"kind": "set",
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 180,
"end": 185,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 19
},
"identifierName": "width"
},
"name": "width"
}
],
"body": {
"type": "BlockStatement",
"start": 187,
"end": 210,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 44
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 189,
"end": 208,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 189,
"end": 207,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 189,
"end": 199,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 33
}
},
"object": {
"type": "ThisExpression",
"start": 189,
"end": 193,
"loc": {
"start": {
"line": 9,
"column": 23
},
"end": {
"line": 9,
"column": 27
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 194,
"end": 199,
"loc": {
"start": {
"line": 9,
"column": 28
},
"end": {
"line": 9,
"column": 33
},
"identifierName": "width"
},
"name": "width"
}
},
"right": {
"type": "Identifier",
"start": 202,
"end": 207,
"loc": {
"start": {
"line": 9,
"column": 36
},
"end": {
"line": 9,
"column": 41
},
"identifierName": "width"
},
"name": "width"
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 216,
"end": 266,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 220,
"end": 224,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 12
},
"identifierName": "area"
},
"name": "area"
},
"computed": false,
"kind": "get",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 227,
"end": 266,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 237,
"end": 260,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 31
}
},
"argument": {
"type": "CallExpression",
"start": 244,
"end": 259,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 12,
"column": 30
}
},
"callee": {
"type": "MemberExpression",
"start": 244,
"end": 257,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 12,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 244,
"end": 248,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 12,
"column": 19
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 249,
"end": 257,
"loc": {
"start": {
"line": 12,
"column": 20
},
"end": {
"line": 12,
"column": 28
},
"identifierName": "calcArea"
},
"name": "calcArea"
}
},
"arguments": []
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 272,
"end": 331,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 17,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 272,
"end": 280,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 12
},
"identifierName": "calcArea"
},
"name": "calcArea"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 283,
"end": 331,
"loc": {
"start": {
"line": 15,
"column": 15
},
"end": {
"line": 17,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 293,
"end": 325,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 40
}
},
"argument": {
"type": "BinaryExpression",
"start": 300,
"end": 324,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 39
}
},
"left": {
"type": "MemberExpression",
"start": 300,
"end": 311,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 300,
"end": 304,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 19
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 305,
"end": 311,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 26
},
"identifierName": "height"
},
"name": "height"
}
},
"operator": "*",
"right": {
"type": "MemberExpression",
"start": 314,
"end": 324,
"loc": {
"start": {
"line": 16,
"column": 29
},
"end": {
"line": 16,
"column": 39
}
},
"object": {
"type": "ThisExpression",
"start": 314,
"end": 318,
"loc": {
"start": {
"line": 16,
"column": 29
},
"end": {
"line": 16,
"column": 33
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 319,
"end": 324,
"loc": {
"start": {
"line": 16,
"column": 34
},
"end": {
"line": 16,
"column": 39
},
"identifierName": "width"
},
"name": "width"
}
}
}
}
],
"directives": []
}
}
]
}
},
{
"type": "VariableDeclaration",
"start": 335,
"end": 372,
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 20,
"column": 37
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 341,
"end": 371,
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 341,
"end": 347,
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 12
},
"identifierName": "square"
},
"name": "square"
},
"init": {
"type": "NewExpression",
"start": 350,
"end": 371,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 36
}
},
"callee": {
"type": "Identifier",
"start": 354,
"end": 363,
"loc": {
"start": {
"line": 20,
"column": 19
},
"end": {
"line": 20,
"column": 28
},
"identifierName": "Rectangle"
},
"name": "Rectangle"
},
"arguments": [
{
"type": "NumericLiteral",
"start": 364,
"end": 366,
"loc": {
"start": {
"line": 20,
"column": 29
},
"end": {
"line": 20,
"column": 31
}
},
"extra": {
"rawValue": 10,
"raw": "10"
},
"value": 10
},
{
"type": "NumericLiteral",
"start": 368,
"end": 370,
"loc": {
"start": {
"line": 20,
"column": 33
},
"end": {
"line": 20,
"column": 35
}
},
"extra": {
"rawValue": 10,
"raw": "10"
},
"value": 10
}
]
}
}
],
"kind": "const"
},
{
"type": "ExpressionStatement",
"start": 374,
"end": 399,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 22,
"column": 25
}
},
"expression": {
"type": "CallExpression",
"start": 374,
"end": 398,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 22,
"column": 24
}
},
"callee": {
"type": "MemberExpression",
"start": 374,
"end": 385,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 22,
"column": 11
}
},
"object": {
"type": "Identifier",
"start": 374,
"end": 381,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 22,
"column": 7
},
"identifierName": "console"
},
"name": "console"
},
"computed": false,
"property": {
"type": "Identifier",
"start": 382,
"end": 385,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 11
},
"identifierName": "log"
},
"name": "log"
}
},
"arguments": [
{
"type": "MemberExpression",
"start": 386,
"end": 397,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 23
}
},
"object": {
"type": "Identifier",
"start": 386,
"end": 392,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 18
},
"identifierName": "square"
},
"name": "square"
},
"computed": false,
"property": {
"type": "Identifier",
"start": 393,
"end": 397,
"loc": {
"start": {
"line": 22,
"column": 19
},
"end": {
"line": 22,
"column": 23
},
"identifierName": "area"
},
"name": "area"
}
}
]
}
}
],
"directives": []
},
"comments": []
}