Debian Codegraph @

packages/babel-parser/test/fixtures/flow/this-annotation/this-constructor/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":42,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":42}},
4 "errors": [
5 "SyntaxError: Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions. (2:2)"
6 ],
7 "program": {
8 "type": "Program",
9 "start":0,"end":42,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":42}},
10 "sourceType": "module",
11 "interpreter": null,
12 "body": [
13 {
14 "type": "ClassDeclaration",
15 "start":0,"end":42,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":1,"index":42}},
16 "id": {
17 "type": "Identifier",
18 "start":6,"end":7,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":7,"index":7},"identifierName":"A"},
19 "name": "A"
20 },
21 "superClass": null,
22 "body": {
23 "type": "ClassBody",
24 "start":8,"end":42,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":3,"column":1,"index":42}},
25 "body": [
26 {
27 "type": "ClassMethod",
28 "start":12,"end":40,"loc":{"start":{"line":2,"column":2,"index":12},"end":{"line":2,"column":30,"index":40}},
29 "static": false,
30 "key": {
31 "type": "Identifier",
32 "start":12,"end":23,"loc":{"start":{"line":2,"column":2,"index":12},"end":{"line":2,"column":13,"index":23},"identifierName":"constructor"},
33 "name": "constructor"
34 },
35 "computed": false,
36 "kind": "constructor",
37 "id": null,
38 "generator": false,
39 "async": false,
40 "params": [
41 {
42 "type": "Identifier",
43 "start":24,"end":36,"loc":{"start":{"line":2,"column":14,"index":24},"end":{"line":2,"column":26,"index":36},"identifierName":"this"},
44 "name": "this",
45 "typeAnnotation": {
46 "type": "TypeAnnotation",
47 "start":28,"end":36,"loc":{"start":{"line":2,"column":18,"index":28},"end":{"line":2,"column":26,"index":36}},
48 "typeAnnotation": {
49 "type": "StringTypeAnnotation",
50 "start":30,"end":36,"loc":{"start":{"line":2,"column":20,"index":30},"end":{"line":2,"column":26,"index":36}}
51 }
52 }
53 }
54 ],
55 "body": {
56 "type": "BlockStatement",
57 "start":38,"end":40,"loc":{"start":{"line":2,"column":28,"index":38},"end":{"line":2,"column":30,"index":40}},
58 "body": [],
59 "directives": []
60 }
61 }
62 ]
63 }
64 }
65 ],
66 "directives": []
67 }
68 }