Skip to content

test262: Boolean conformance fixes (wave 13) - #71

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

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

Conversation

@hiett

@hiett hiett commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Boolean (test/built-ins/Boolean) is near-maxed for family-local work. The three reachable harvest targets — the ToBoolean truthiness table behind Boolean(x) (ECMA-262 §7.1.2 / §20.3.1.1), new Boolean(x) wrapper valueOf/toString (§20.3.3.2/.3) including the no-argument default of false, and applying those prototype methods to a wrapper receiver via .callalready compute the spec-correct result in the current runtime (verified with 33 direct assertions). No behavioral fix was warranted.

This PR adds spec-cited regression tests (append-only, at EOF under // ==== Boolean (wave 13) ====) that lock in that behavior so future changes to the coercion path (truthy/1) or the wrapper dispatch (date_call/to_string_dispatch) cannot silently regress it.

Why nothing else is fixable in-family

Every remaining test262 Boolean failure needs out-of-scope / shared or tarpit features, not Boolean-specific code:

  • new Object(...) — generic Object constructor (9 compile_unsupported)
  • constructor-object reflection: Boolean.prototype, Boolean.length, Boolean.prototype.constructor, Function.prototype.isPrototypeOf(Boolean), hasOwnProperty/for-in on the constructor
  • delete Boolean.prototype.toString + [object Boolean] via Object.prototype.toString
  • Object.defineProperty / Symbol coercion (deliberate tarpits)

Verification

gleam format clean, gleam build warning-free, gleam test -- js_compiler_test: 2784 passed, 3 failures (all pre-existing WASM .wat fixtures, unrelated). No FFI changes.

…ntics

The Boolean family's reachable behavior — the ToBoolean truthiness table
behind Boolean(x) (ECMA-262 §7.1.2 / §20.3.1.1), the wrapper default and
boxed [[BooleanData]] exposed through new Boolean(x).valueOf()/toString()
(§20.3.3.2/.3), and applying those prototype methods to a wrapper receiver
via .call — already computes the spec-correct result. Add spec-cited
regression tests asserting those values so future changes to the coercion
path or the wrapper dispatch cannot silently regress them.
@hiett
hiett merged commit b12c63e 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