Skip to content

runtime: builtin own-property descriptor attributes wrong + getOwnPropertyDescriptor returns undefined #4139

Description

@proggeramlug

Summary

Built-in own properties are installed with wrong descriptor attributes, and
Object.getOwnPropertyDescriptor returns undefined for many builtin own
properties. A fresh parity sweep (2026-06-02, on top of the #3655 fixes) shows
~170 failures in this single subsystem — now the largest behavioral cluster.

This is the direct follow-on to #3655 / closed #3143: those made name/length
exist as own properties, but (a) their descriptor flags are wrong and (b) other
builtin own properties aren't visible to the reflection APIs at all.

Two sub-bugs (same subsystem)

(a) Wrong descriptor attributes — ~140 failures. Builtin name/length/
method/constant own properties report the wrong {writable, enumerable, configurable}. Spec: function name/length are {writable:false, enumerable:false, configurable:true}. Perry reports them non-configurable
(and some as writable).

  • built-ins/ArrayBuffer/{name,length}.js — "length descriptor should be configurable" / "should not be writable"
  • built-ins/AsyncFunction/{instance-has-name,instance-length}.js
  • built-ins/AsyncGeneratorFunction/{name,length}.js
  • spans TypedArray, NativeErrors, Map, Set, WeakMap, WeakSet, BigInt, Symbol,
    Boolean, ArrayBuffer (18 categories total)

(b) getOwnPropertyDescriptor returns undefined — ~30 failures. For builtin
methods/constants the descriptor lookup returns undefined, so test262's
verifyProperty dereferences it ("Cannot read properties of undefined (reading
'enumerable'/'value')") or Object(undefined) throws ("Cannot convert undefined
or null to object").

  • built-ins/Math/prop-desc.jsCannot read properties of undefined (reading 'enumerable')
  • built-ins/Math/{length,name}.js… (reading 'value')
  • built-ins/ArrayIteratorPrototype/{length,name}.js, AsyncFunction/AsyncFunction-{length,name,prototype}.jsCannot convert undefined or null to object

Repro

console.log(Object.getOwnPropertyDescriptor(Array.from, 'name'));
// expect { value:'from', writable:false, enumerable:false, configurable:true }
console.log(Object.getOwnPropertyDescriptor(Math, 'abs'));   // Perry: undefined
console.log(Object.getOwnPropertyDescriptor(Math.abs, 'length')); // Perry: undefined

Why high-leverage

One descriptor-installation/reflection fix clears ~170 failures across ~25
categories, and unblocks verifyProperty-based assertions that currently abort
on this check across the whole test262 built-ins tree.

Suggested scope

(1) Install builtin own name/length/method/constant properties with the
spec-correct descriptor attributes; (2) make Object.getOwnPropertyDescriptor /
getOwnPropertyNames see builtin own properties (Math, iterator prototypes,
function objects).


Filed from the parity-gap radar (scripts/parity_gap_report.py), 2026-06-02
re-sweep. Follow-on to #3655 / #3143.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions