Skip to content

test262: Reflect conformance fixes (wave 13) - #73

Merged
hiett merged 1 commit into
experiment/js-frontendfrom
js262/wave13-Reflect
Jul 15, 2026
Merged

test262: Reflect conformance fixes (wave 13)#73
hiett merged 1 commit into
experiment/js-frontendfrom
js262/wave13-Reflect

Conversation

@hiett

@hiett hiett commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Models the receiver argument of Reflect.set(target, key, V[, receiver]) per ECMAScript §28.1.13 / OrdinarySetWithOwnDescriptor (9.1.9.2).

  • Receiver omitted → defaults to the target, so the ordinary 3-arg form still writes on the target.
  • A distinct receiver object diverts the data write there and leaves the target untouched (steps 5.c–f).
  • A non-Object (primitive) receiver returns false and writes nothing (step 5.b).
  • A frozen target (non-writable data descriptor, step 5.a), a frozen receiver, or a non-extensible receiver lacking the key reports false.

Fixes test262 Reflect/set/receiver-is-not-object.js and Reflect/set/set-value-on-data-descriptor.js; Reflect family pass 23 → 25. Four spec-driven unit tests added at EOF of js_compiler_test.gleam.

Touches: twocore_rt_js_ffi.erl (reflect_set/3 → /4), emit_core.gleam allow-list (unchanged op name), rt_js.gleam @external, lower.gleam dispatch.

Reflect.set(target, key, V, receiver) now honours the receiver argument of
OrdinarySetWithOwnDescriptor (9.1.9.2). With the receiver omitted it defaults
to the target so the ordinary three-argument form still writes on the target;
a distinct receiver object diverts the data write there and leaves the target
untouched; a non-Object (primitive) receiver, a frozen receiver, or a
non-extensible receiver lacking the key reports false. Fixes the two
receiver-sensitive test262 Reflect/set assertions.
@hiett
hiett merged commit 29958c6 into experiment/js-frontend Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant