test262: Boolean conformance fixes (wave 13) - #71
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)wrappervalueOf/toString(§20.3.3.2/.3) including the no-argument default offalse, and applying those prototype methods to a wrapper receiver via.call— already 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)Boolean.prototype,Boolean.length,Boolean.prototype.constructor,Function.prototype.isPrototypeOf(Boolean),hasOwnProperty/for-inon the constructordelete Boolean.prototype.toString+[object Boolean]via Object.prototype.toStringObject.defineProperty/ Symbol coercion (deliberate tarpits)Verification
gleam formatclean,gleam buildwarning-free,gleam test -- js_compiler_test: 2784 passed, 3 failures (all pre-existing WASM .wat fixtures, unrelated). No FFI changes.