Files
eslint/tests/fixtures/code-path-analysis/object-literal--conditional.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

21 lines
837 B
JavaScript

/*expected
initial->s1_1->s1_2->s1_4;
s1_1->s1_3->s1_4->final;
*/
x = { a: b ? c : d }
/*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];
s1_1[label="Program:enter\nExpressionStatement:enter\nAssignmentExpression:enter\nIdentifier (x)\nObjectExpression:enter\nProperty:enter\nIdentifier (a)\nConditionalExpression:enter\nIdentifier
(b)"];
s1_2[label="Identifier (c)"];
s1_4[label="ConditionalExpression:exit\nProperty:exit\nObjectExpression:exit\nAssignmentExpression:exit\nExpressionStatement:exit\nProgram:exit"];
s1_3[label="Identifier (d)"];
initial->s1_1->s1_2->s1_4;
s1_1->s1_3->s1_4->final;
}*/