Skip to content

fix(runtime): built-ins/Object test262 residue#5025

Merged
proggeramlug merged 1 commit into
mainfrom
object-residue-parity
Jun 11, 2026
Merged

fix(runtime): built-ins/Object test262 residue#5025
proggeramlug merged 1 commit into
mainfrom
object-residue-parity

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Mops up the built-ins/Object test262 residue: 3026/3173 (95.4%) → 3062/3173 (96.5%), +36, zero regressions (verified by diffing the per-test failure set before/after — no test that passed on main regresses).

Root causes (4 shared)

1. Array [[DefineOwnProperty]] skipped non-configurable validation. Object.defineProperty/defineProperties on an array did not run ValidateAndApplyPropertyDescriptor for an existing non-configurable property on two paths:

  • the index-accessor branch only rejected a data→accessor conversion, not a get/set change on an already-non-configurable accessor;
  • the named (non-index) branch did no validation at all, so redefining a non-configurable arr.prop silently succeeded.

Both now route through the existing validate_nonconfigurable_redefine (which compares accessors by func_ptr, immune to the receiver-rebind clone).

2. Object.freeze/Object.seal on arrays missed elements + named props. mark_all_keys only walks (*obj).keys_array; an array's indices live in the dense element store and its named props in ARRAY_NAMED_PROPS — neither is in keys_array. New mark_all_array_props records the dropped writable/configurable attrs on the side tables (gated by OBJ_FLAG_ARRAY_DESCRIPTORS).

3. Exotic-Error builtin slots defaulted to enumerable. A plain err.message = x is a [[Set]] and must not change attributes, but propertyIsEnumerable/own-key enumeration defaulted Error message/stack to enumerable when no explicit attr entry existed — so Object.defineProperties(obj, errObj) wrongly processed them. New exotic_default_enumerable keeps them non-enumerable.

4. js_dynamic_object_get_property ignored Error expandos. It returned undefined for any Error property outside the five native slots, ignoring defineProperty-installed accessor/data expandos — so defineProperties read each descriptor off an Error properties-bag as undefined and threw Property description must be an object: undefined. It now consults the exotic side tables first.

Files

  • object/array_object_ops.rs — array define validation + mark_all_array_props
  • object/object_ops_frozen.rs — wire freeze/seal to the array path
  • object/exotic_expando.rsexotic_default_enumerable
  • object/object_ops.rspropertyIsEnumerable exotic default
  • value/dynamic_object.rs — Error dynamic-get consults expandos

Validation

test262_subset.py --dir built-ins/Object against tc39/test262 @ 4249661, Node v26.3.0 oracle: pass 3026→3062, runtime-fail 147→111, 0 newly-broken.

…tion on arrays, freeze/seal on arrays, exotic-Error enumerability + dynamic-get)

Object subset 3026/3173 (95.4%) -> 3062/3173 (96.5%), +36, zero regressions.

Four shared root causes:

1. Array [[DefineOwnProperty]] skipped ValidateAndApplyPropertyDescriptor for
   non-configurable EXISTING properties on two paths: the index-accessor branch
   (only rejected data->accessor conversion, not a get/set change on a
   non-configurable accessor) and the named (non-index) branch (no validation at
   all). Both now route through the shared validate_nonconfigurable_redefine.

2. Object.freeze / Object.seal on arrays missed the dense index elements and the
   ARRAY_NAMED_PROPS named props -- mark_all_keys only walks keys_array, which
   for an array holds neither. New mark_all_array_props records the attrs on the
   side tables (gated by OBJ_FLAG_ARRAY_DESCRIPTORS).

3. A plain write to an Error's builtin non-enumerable slot (err.message = x) is a
   [[Set]] and must not change attributes, but propertyIsEnumerable / own-key
   enumeration defaulted Error message/stack to enumerable when no explicit attr
   entry existed. New exotic_default_enumerable keeps them non-enumerable.

4. js_dynamic_object_get_property returned undefined for any Error property
   outside the five native slots, ignoring defineProperty-installed
   accessor/data expandos -- so Object.defineProperties(obj, errObj) read every
   descriptor as undefined and threw. It now consults the exotic side tables
   first.
@proggeramlug proggeramlug merged commit 2dadd40 into main Jun 11, 2026
11 of 13 checks passed
@proggeramlug proggeramlug deleted the object-residue-parity branch June 11, 2026 21:58
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