swc/crates/swc_estree_compat/tests/fixtures/class-extends/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

956 lines
50 KiB
JSON

{
"type": "File",
"start": 0,
"end": 292,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 20,
"column": 0
}
},
"errors": [],
"program": {
"type": "Program",
"start": 0,
"end": 292,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 20,
"column": 0
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start": 0,
"end": 145,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 9,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 12
},
"identifierName": "Animal"
},
"name": "Animal"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 13,
"end": 145,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 9,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 19,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 4,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 19,
"end": 30,
"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": 31,
"end": 35,
"loc": {
"start": {
"line": 2,
"column": 16
},
"end": {
"line": 2,
"column": 20
},
"identifierName": "name"
},
"name": "name"
}
],
"body": {
"type": "BlockStatement",
"start": 37,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 22
},
"end": {
"line": 4,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 47,
"end": 64,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 47,
"end": 63,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 47,
"end": 56,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 47,
"end": 51,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 12
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 52,
"end": 56,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 17
},
"identifierName": "name"
},
"name": "name"
}
},
"right": {
"type": "Identifier",
"start": 59,
"end": 63,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 24
},
"identifierName": "name"
},
"name": "name"
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 76,
"end": 143,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 8,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 76,
"end": 81,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 9
},
"identifierName": "speak"
},
"name": "speak"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 84,
"end": 143,
"loc": {
"start": {
"line": 6,
"column": 12
},
"end": {
"line": 8,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 94,
"end": 137,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 51
}
},
"expression": {
"type": "CallExpression",
"start": 94,
"end": 136,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 50
}
},
"callee": {
"type": "MemberExpression",
"start": 94,
"end": 105,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 19
}
},
"object": {
"type": "Identifier",
"start": 94,
"end": 101,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 15
},
"identifierName": "console"
},
"name": "console"
},
"computed": false,
"property": {
"type": "Identifier",
"start": 102,
"end": 105,
"loc": {
"start": {
"line": 7,
"column": 16
},
"end": {
"line": 7,
"column": 19
},
"identifierName": "log"
},
"name": "log"
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 106,
"end": 135,
"loc": {
"start": {
"line": 7,
"column": 20
},
"end": {
"line": 7,
"column": 49
}
},
"expressions": [
{
"type": "MemberExpression",
"start": 109,
"end": 118,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 32
}
},
"object": {
"type": "ThisExpression",
"start": 109,
"end": 113,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 27
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 114,
"end": 118,
"loc": {
"start": {
"line": 7,
"column": 28
},
"end": {
"line": 7,
"column": 32
},
"identifierName": "name"
},
"name": "name"
}
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 107,
"end": 107,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 21
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 119,
"end": 134,
"loc": {
"start": {
"line": 7,
"column": 33
},
"end": {
"line": 7,
"column": 48
}
},
"value": {
"raw": " makes a noise.",
"cooked": " makes a noise."
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ClassDeclaration",
"start": 147,
"end": 291,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 19,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 153,
"end": 156,
"loc": {
"start": {
"line": 11,
"column": 6
},
"end": {
"line": 11,
"column": 9
},
"identifierName": "Dog"
},
"name": "Dog"
},
"superClass": {
"type": "Identifier",
"start": 165,
"end": 171,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 11,
"column": 24
},
"identifierName": "Animal"
},
"name": "Animal"
},
"body": {
"type": "ClassBody",
"start": 172,
"end": 291,
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 19,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 178,
"end": 224,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 14,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 178,
"end": 189,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"computed": false,
"kind": "constructor",
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 190,
"end": 194,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 20
},
"identifierName": "name"
},
"name": "name"
}
],
"body": {
"type": "BlockStatement",
"start": 196,
"end": 224,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 14,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 206,
"end": 218,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 20
}
},
"expression": {
"type": "CallExpression",
"start": 206,
"end": 217,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 19
}
},
"callee": {
"type": "Super",
"start": 206,
"end": 211,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"start": 212,
"end": 216,
"loc": {
"start": {
"line": 13,
"column": 14
},
"end": {
"line": 13,
"column": 18
},
"identifierName": "name"
},
"name": "name"
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 230,
"end": 289,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 230,
"end": 235,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 9
},
"identifierName": "speak"
},
"name": "speak"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 238,
"end": 289,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 18,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 248,
"end": 283,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 43
}
},
"expression": {
"type": "CallExpression",
"start": 248,
"end": 282,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 248,
"end": 259,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 19
}
},
"object": {
"type": "Identifier",
"start": 248,
"end": 255,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 15
},
"identifierName": "console"
},
"name": "console"
},
"computed": false,
"property": {
"type": "Identifier",
"start": 256,
"end": 259,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 19
},
"identifierName": "log"
},
"name": "log"
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 260,
"end": 281,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 41
}
},
"expressions": [
{
"type": "MemberExpression",
"start": 263,
"end": 272,
"loc": {
"start": {
"line": 17,
"column": 23
},
"end": {
"line": 17,
"column": 32
}
},
"object": {
"type": "ThisExpression",
"start": 263,
"end": 267,
"loc": {
"start": {
"line": 17,
"column": 23
},
"end": {
"line": 17,
"column": 27
}
}
},
"computed": false,
"property": {
"type": "Identifier",
"start": 268,
"end": 272,
"loc": {
"start": {
"line": 17,
"column": 28
},
"end": {
"line": 17,
"column": 32
},
"identifierName": "name"
},
"name": "name"
}
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 261,
"end": 261,
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 21
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 273,
"end": 280,
"loc": {
"start": {
"line": 17,
"column": 33
},
"end": {
"line": 17,
"column": 40
}
},
"value": {
"raw": " barks.",
"cooked": " barks."
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
]
}
}
],
"directives": []
},
"comments": []
}