fix(runtime): built-ins/Object test262 residue#5025
Merged
Conversation
…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.
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
Mops up the
built-ins/Objecttest262 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 onmainregresses).Root causes (4 shared)
1. Array
[[DefineOwnProperty]]skipped non-configurable validation.Object.defineProperty/definePropertieson an array did not run ValidateAndApplyPropertyDescriptor for an existing non-configurable property on two paths:get/setchange on an already-non-configurable accessor;arr.propsilently succeeded.Both now route through the existing
validate_nonconfigurable_redefine(which compares accessors byfunc_ptr, immune to the receiver-rebind clone).2.
Object.freeze/Object.sealon arrays missed elements + named props.mark_all_keysonly walks(*obj).keys_array; an array's indices live in the dense element store and its named props inARRAY_NAMED_PROPS— neither is inkeys_array. Newmark_all_array_propsrecords the droppedwritable/configurableattrs on the side tables (gated byOBJ_FLAG_ARRAY_DESCRIPTORS).3. Exotic-Error builtin slots defaulted to enumerable. A plain
err.message = xis a[[Set]]and must not change attributes, butpropertyIsEnumerable/own-key enumeration defaulted Errormessage/stackto enumerable when no explicit attr entry existed — soObject.defineProperties(obj, errObj)wrongly processed them. Newexotic_default_enumerablekeeps them non-enumerable.4.
js_dynamic_object_get_propertyignored Error expandos. It returnedundefinedfor any Error property outside the five native slots, ignoringdefineProperty-installed accessor/data expandos — sodefinePropertiesread each descriptor off an Error properties-bag asundefinedand threwProperty 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_propsobject/object_ops_frozen.rs— wire freeze/seal to the array pathobject/exotic_expando.rs—exotic_default_enumerableobject/object_ops.rs—propertyIsEnumerableexotic defaultvalue/dynamic_object.rs— Error dynamic-get consults expandosValidation
test262_subset.py --dir built-ins/Objectagainst tc39/test262 @4249661, Node v26.3.0 oracle: pass 3026→3062, runtime-fail 147→111, 0 newly-broken.