]> git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/fixtures/code-path-analysis/switch--cases-and-default-3.js
first commit
[pve-eslint.git] / eslint / tests / fixtures / code-path-analysis / switch--cases-and-default-3.js
1 /*expected
2 initial->s1_1->s1_2->s1_3->s1_9->s1_10->s1_12->s1_13;
3 s1_1->s1_4->s1_6->s1_8->s1_9;
4 s1_2->s1_13;
5 s1_9->s1_13;
6 s1_6->s1_9;
7 s1_8->s1_11->s1_12;
8 s1_11->s1_9;
9 s1_13->final;
10 */
11
12 switch (a) {
13 case 0:
14 foo();
15 break;
16
17 default:
18 case 1:
19 case 2:
20 bar();
21 break;
22
23 case 3:
24 fuga();
25 }
26
27 /*DOT
28 digraph {
29 node[shape=box,style="rounded,filled",fillcolor=white];
30 initial[label="",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];
31 final[label="",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];
32 s1_1[label="Program\nSwitchStatement\nIdentifier (a)\nSwitchCase\nLiteral (0)"];
33 s1_2[label="ExpressionStatement\nCallExpression\nIdentifier (foo)\nBreakStatement"];
34 s1_3[style="rounded,dashed,filled",fillcolor="#FF9800",label="<<unreachable>>\nSwitchCase:exit"];
35 s1_9[label="ExpressionStatement\nCallExpression\nIdentifier (bar)\nBreakStatement"];
36 s1_10[style="rounded,dashed,filled",fillcolor="#FF9800",label="<<unreachable>>\nSwitchCase:exit"];
37 s1_12[label="ExpressionStatement\nCallExpression\nIdentifier (fuga)"];
38 s1_13[label="SwitchStatement:exit\nProgram:exit"];
39 s1_4[label="SwitchCase"];
40 s1_6[label="SwitchCase\nLiteral (1)"];
41 s1_8[label="SwitchCase\nLiteral (2)"];
42 s1_11[label="SwitchCase\nLiteral (3)"];
43 initial->s1_1->s1_2->s1_3->s1_9->s1_10->s1_12->s1_13;
44 s1_1->s1_4->s1_6->s1_8->s1_9;
45 s1_2->s1_13;
46 s1_9->s1_13;
47 s1_6->s1_9;
48 s1_8->s1_11->s1_12;
49 s1_11->s1_9;
50 s1_13->final;
51 }
52 */