tc39/proposal-logical-assignment

Stage 3 review

bakkot opened this issue · 1 comments

  • Is there a reason that LogicalAssignmentPunctuator is its own production? I would expect to just add the new ones to OtherPunctuator. (OptionalChainingPunctuator is special in that it has a lookahead restriction, which this does not.)
  • Is there a reason the algorithm for ??= is structured differently than the algorithms for &&= and ||=? I think there's value in consistency here (so 3. If lval is neither undefined nor null, return lval. 4. Let rref [etc]).

Otherwise looks good to me.

Is there a reason that LogicalAssignmentPunctuator is its own production?

I couldn't get the pretty <ins> decoration to work with it as part of OtherPunctuator. So I made it a new production.

Is there a reason the algorithm for ??= is structured differently than the algorithms for &&= and ||=?

Updated.