I suspect this is because the variable flattener doesn't like how previous phases transpile local assignment in a way that creates a temporary variable.
Input:
class MyClass {}
console.log(() => {
return (MyClass.myField ??= {});
});
with flags:
-O ADVANCED
--js in.js
--language_in ECMASCRIPT_NEXT
--language_out ECMASCRIPT_2020
Output:
class a{}console.log(()=>a.g??{});
Expected output:
// any of
class a{}console.log(()=>a.g??={});
var x;console.log(() => x??={});
var x;console.log(() => x??(x={}));
class a{};console.log(() => a.g??(a.g={}));