Files
eslint/tests/fixtures/code-path-analysis/class-fields-init--arrow-function.js
bdd4c54bdb Update: Code path analysis for class fields (fixes #14343) (#14886)
* Fix: Code path analysis for class fields (fixes #14343)

* PropertyDefinition code paths

* Add test and comments

* Reverse order of code path closing

* Added CodePath#origin

* Update tests/lib/linter/code-path-analysis/code-path.js

Co-authored-by: Milos Djermanovic <[email protected]>

* Update lib/linter/code-path-analysis/code-path.js

Co-authored-by: Milos Djermanovic <[email protected]>

Co-authored-by: Milos Djermanovic <[email protected]>
2021-08-26 23:27:10 +02:00

38 lines
1.3 KiB
JavaScript

/*expected
initial->s3_1->final;
*/
/*expected
initial->s2_1->final;
*/
/*expected
initial->s1_1->final;
*/
class Foo { a = () => b }
/*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];
s3_1[label="ArrowFunctionExpression:enter\nIdentifier (b)\nArrowFunctionExpression:exit"];
initial->s3_1->final;
}
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];
s2_1[label="ArrowFunctionExpression"];
initial->s2_1->final;
}
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];
s1_1[label="Program:enter\nClassDeclaration:enter\nIdentifier (Foo)\nClassBody:enter\nPropertyDefinition:enter\nIdentifier (a)\nArrowFunctionExpression\nPropertyDefinition:exit\nClassBody:exit\nClassDeclaration:exit\nProgram:exit"];
initial->s1_1->final;
}
*/