mirror of
https://github.com/hanzoai/eslint.git
synced 2026-10-30 19:38:10 +00:00
* fix: ref in finally block * resumption of CallExpression path in catch block * fix CI errors * update paths for other expressions * update id reference path in catch and add tests * merge try and catch function and ad test * Update lib/linter/code-path-analysis/code-path-state.js Co-authored-by: Francesco Trotta <[email protected]> * update function name --------- Co-authored-by: Francesco Trotta <[email protected]>
40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
/*expected
|
|
initial->s1_1->s1_2->s1_3->s1_4->s1_6;
|
|
s1_1->s1_3;
|
|
s1_2->s1_6;
|
|
s1_3->s1_7;
|
|
s1_4->s1_7;
|
|
s1_6->final;
|
|
s1_7->thrown;
|
|
*/
|
|
|
|
try {
|
|
new Foo();
|
|
} catch (err) {
|
|
new Bar();
|
|
} finally {
|
|
console.log("Done");
|
|
}
|
|
|
|
/*DOT
|
|
digraph {
|
|
node[shape=box,style="rounded,filled",fillcolor=white];
|
|
initial[label="",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];
|
|
final[label="",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];
|
|
thrown[label="✘",shape=circle,width=0.3,height=0.3,fixedsize=true];
|
|
s1_1[label="Program:enter\nTryStatement:enter\nBlockStatement:enter\nExpressionStatement:enter\nNewExpression:enter\nIdentifier (Foo)"];
|
|
s1_2[label="NewExpression:exit\nExpressionStatement:exit\nBlockStatement:exit"];
|
|
s1_3[label="CatchClause:enter\nIdentifier (err)\nBlockStatement:enter\nExpressionStatement:enter\nNewExpression:enter\nIdentifier (Bar)"];
|
|
s1_4[label="NewExpression:exit\nExpressionStatement:exit\nBlockStatement:exit\nCatchClause:exit"];
|
|
s1_6[label="BlockStatement:enter\nExpressionStatement:enter\nCallExpression:enter\nMemberExpression:enter\nIdentifier (console)\nIdentifier (log)\nMemberExpression:exit\nLiteral (Done)\nCallExpression:exit\nExpressionStatement:exit\nBlockStatement:exit\nTryStatement:exit\nProgram:exit"];
|
|
s1_7[label="BlockStatement:enter\nExpressionStatement:enter\nCallExpression:enter\nMemberExpression:enter\nIdentifier (console)\nIdentifier (log)\nMemberExpression:exit\nLiteral (Done)\nCallExpression:exit\nExpressionStatement:exit\nBlockStatement:exit"];
|
|
initial->s1_1->s1_2->s1_3->s1_4->s1_6;
|
|
s1_1->s1_3;
|
|
s1_2->s1_6;
|
|
s1_3->s1_7;
|
|
s1_4->s1_7;
|
|
s1_6->final;
|
|
s1_7->thrown;
|
|
}
|
|
*/
|