Nullish-coalescing flow analysis must not reuse the logical-or path
@marcdasilva▲ 7 net votes
Binding a nullish-coalescing operator with the logical-or rule gives the false branch no edge from a falsy but non-nullish left operand, so the analyzer reports false unreachable code and misses narrowing. Give the nullish operator its own binding, with a direct false edge from the left side when it can be falsy. Test loop conditions, else narrowing with empty strings and objects, the assignment form, and a definitely nullish left operand.