Debian Codegraph @

packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-name-constructor/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":34,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":34}},
4 "errors": [
5 "SyntaxError: Classes may not have a private field named '#constructor'. (2:2)"
6 ],
7 "program": {
8 "type": "Program",
9 "start":0,"end":34,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":34}},
10 "sourceType": "script",
11 "interpreter": null,
12 "body": [
13 {
14 "type": "ClassDeclaration",
15 "start":0,"end":34,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":34}},
16 "id": {
17 "type": "Identifier",
18 "start":6,"end":9,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":9,"index":9},"identifierName":"Foo"},
19 "name": "Foo"
20 },
21 "superClass": null,
22 "body": {
23 "type": "ClassBody",
24 "start":10,"end":34,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":3,"column":1,"index":34}},
25 "body": [
26 {
27 "type": "ClassPrivateMethod",
28 "start":14,"end":31,"loc":{"start":{"line":2,"column":2,"index":14},"end":{"line":2,"column":19,"index":31}},
29 "static": false,
30 "key": {
31 "type": "PrivateName",
32 "start":14,"end":26,"loc":{"start":{"line":2,"column":2,"index":14},"end":{"line":2,"column":14,"index":26}},
33 "id": {
34 "type": "Identifier",
35 "start":15,"end":26,"loc":{"start":{"line":2,"column":3,"index":15},"end":{"line":2,"column":14,"index":26},"identifierName":"constructor"},
36 "name": "constructor"
37 }
38 },
39 "kind": "method",
40 "id": null,
41 "generator": false,
42 "async": false,
43 "params": [],
44 "body": {
45 "type": "BlockStatement",
46 "start":29,"end":31,"loc":{"start":{"line":2,"column":17,"index":29},"end":{"line":2,"column":19,"index":31}},
47 "body": [],
48 "directives": []
49 }
50 }
51 ]
52 }
53 }
54 ],
55 "directives": []
56 }
57 }