ReviewOS

zig-utils/zig-js

Compiler: lower super member logical assignments

#720
Closed chris opened this 9 days ago ·
9 days ago

Parents: #465 Related: #705, #708, #715

Problem

Member logical assignments lower across plain, generator, and async activations (#705), but every `super.x &&= v` / `super[k] ||= v` form remains causally rejected. `compileSuperRef` supports deferred ToPropertyKey and activation temps for plain writes (#715), yet the three logical operators still take the unsupported path because PutValue against a SuperReference needs a receiver-aware write opcode that keeps `thisValue` as the receiver rather than the home-object base.

Scope

  • Add or extend a super write path that preserves MakeSuperPropertyReference semantics: base from GetSuperBase once, receiver = `this`, key coerced exactly once before GetValue.
  • Lower all three logical operators for named and computed super targets in method bodies across tiers, including generator/async suspension between GetValue and PutValue.
  • Keep getter/setter dispatch, proxy targets, abrupt completion unwinding, and assignment-result ordering exact against the
9 days ago

Already completed by a5280fad — feat(compiler): lower captured super writes (#715).

That landing added one-time SuperReference capture plus receiver-aware super_get_from and super_set_from lowering for direct, logical, compound, and update writes. The compiler routes named and computed super targets through compileSuperLogicalAssign for &&=, ||=, and ??=, and the suspendable coverage exercises generator, async, and async-generator getter/RHS suspension with prototype mutation and GC.

Recorded evidence on #715: full units 1,830 passed / 1 skipped / 0 failed or leaked; focused normal and TSan 5/5; broad super units 12/12; frontend 12/12; exact-parent Test262 super 94/94 → 94/94 and assignment 485/485 → 485/485, with 0 flips and 0 regressions.

No duplicate code change is needed here. Closing this stale follow-up as completed by #715.

Sign in to comment on this issue.