Debian Codegraph @

packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-if/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":33,"index":33}},
4 "errors": [
5 "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement. (1:17)"
6 ],
7 "program": {
8 "type": "Program",
9 "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":33,"index":33}},
10 "sourceType": "script",
11 "interpreter": null,
12 "body": [
13 {
14 "type": "IfStatement",
15 "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":33,"index":33}},
16 "test": {
17 "type": "NumericLiteral",
18 "start":4,"end":5,"loc":{"start":{"line":1,"column":4,"index":4},"end":{"line":1,"column":5,"index":5}},
19 "extra": {
20 "rawValue": 1,
21 "raw": "1"
22 },
23 "value": 1
24 },
25 "consequent": {
26 "type": "LabeledStatement",
27 "start":7,"end":33,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":33,"index":33}},
28 "body": {
29 "type": "LabeledStatement",
30 "start":12,"end":33,"loc":{"start":{"line":1,"column":12,"index":12},"end":{"line":1,"column":33,"index":33}},
31 "body": {
32 "type": "FunctionDeclaration",
33 "start":17,"end":33,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":1,"column":33,"index":33}},
34 "id": {
35 "type": "Identifier",
36 "start":26,"end":29,"loc":{"start":{"line":1,"column":26,"index":26},"end":{"line":1,"column":29,"index":29},"identifierName":"foo"},
37 "name": "foo"
38 },
39 "generator": false,
40 "async": false,
41 "params": [],
42 "body": {
43 "type": "BlockStatement",
44 "start":31,"end":33,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":33,"index":33}},
45 "body": [],
46 "directives": []
47 }
48 },
49 "label": {
50 "type": "Identifier",
51 "start":12,"end":15,"loc":{"start":{"line":1,"column":12,"index":12},"end":{"line":1,"column":15,"index":15},"identifierName":"bar"},
52 "name": "bar"
53 }
54 },
55 "label": {
56 "type": "Identifier",
57 "start":7,"end":10,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":10,"index":10},"identifierName":"foo"},
58 "name": "foo"
59 }
60 },
61 "alternate": null
62 }
63 ],
64 "directives": []
65 }
66 }