Skip to content

runtime: Object.defineProperty on a handle-band object (zlib stream, fetch Headers) throws TypeError instead of defining #6363

Description

@proggeramlug

Summary

Object.defineProperty() on a handle-band object (a native-backed value such as a zlib stream or a fetch Headers) throws TypeError instead of defining the property.

This is an untriaged gap-suite failure on maintest_gap_handle_band_object_ops fails and is not in test-parity/known_failures.json, so it should be failing the conformance-smoke gate but isn't (see the CI blind spot below).

Repro

test-files/test_gap_handle_band_object_ops.ts on current main (be5ed2bfc), compiled on the auto-optimize path and diffed against node --experimental-strip-types:

                                          perry                    node
gzipStream.defineProperty completes:      throw TypeError          true
headers.defineProperty completes:         throw TypeError          true

Why it matters

Object.defineProperty on a native-backed object is ordinary JS — libraries do it constantly (adding non-enumerable metadata, shimming, instrumenting). A hard TypeError where node returns true will break packages in ways that look nothing like a Perry bug.

Same family as #6271 (handle-band deref) and the 0x1000-floor probes fixed in #6346: values in the small-handle band (< HANDLE_BAND_MAX, 0x100000) are NaN-boxed registry ids, not heap pointers, and the generic object ops reject them rather than routing to the native path.

Why CI never caught it

conformance-smoke runs the gap suite against node --experimental-strip-types with node-version: '22' (.github/workflows/test.yml), while local runs use Node 26. This test's failure is visible on Node 26 and not on CI's Node 22. See the separate issue on the Node-version skew.

Measured baseline on main (quiet box, Node 26, auto-optimize path): 277/295 pass (93.8%), 14 triaged failures, and exactly 2 untriaged — this one and #NNNN (DisposableStack).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions