[codex] Support typed array own properties#4363
Merged
proggeramlug merged 1 commit intoJun 4, 2026
Merged
Conversation
674efd8 to
1674fa5
Compare
proggeramlug
added a commit
that referenced
this pull request
Jun 4, 2026
…et-key buffer metadata (#4399) #4363 (typed array own properties) added a typed-array own-property block at the top of js_object_get_field_by_name that, for a Uint8Array-backed buffer, returns undefined for any key it doesn't recognize. A KeyObject's secret-key backing buffer is a Uint8Array, so its type / symmetricKeySize / asymmetricKey* metadata (resolved by the KeyObject block later in the same function) was shadowed and read back as undefined — a deterministic regression that fails the secret_key_buffer_metadata_survives_ic_miss_for_aes_sizes unit test on main (and every PR's cargo-test). Fix: fall through to the metadata block for a secret-key buffer instead of returning the typed-array undefined fallback. Plain typed arrays are unchanged (still return undefined for unknown keys). cargo test -p perry-runtime --lib: 979 passed, 0 failed (was 1 failed). Co-authored-by: Ralph Küpper <ralph@skelpo.com>
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
Fixes #4349.
This adds typed-array own-property support for Perry's Integer-Indexed exotic objects while preserving element-slot behavior for canonical numeric indices. The change introduces a typed-array own-property side table, routes Object/descriptor/reflection helpers through it, and updates codegen paths that previously lowered Uint8Array string indexes through numeric element access.
Why This PR Cut
This is a focused runtime/codegen compatibility slice for one typed-array object-model gap. It was not batched with unrelated Node modules because the implementation touches a shared object/descriptor/indexing path and has enough reflection and codegen surface to stand alone safely.
Behavior Covered
Object.defineProperty(ta, "length", { value })creates an own property that shadows.lengthreads without changing the indexed element length.Uint8Arraystring index reads/writes route through dynamic typed-array lookup instead of accidental numeric element access.Tests
Added
test-parity/node-suite/globals/typedarray-own-properties.tsplus an expected-output fallback because the local system Node is Node 22 and does not support the TypeScript-strip flag used by the parity runner.Validation run:
NODE26_BIN=$(npm exec --yes --package=node@26 -- node -e 'console.log(process.execPath)'); "$NODE26_BIN" --experimental-strip-types --no-warnings test-parity/node-suite/globals/typedarray-own-properties.ts./run_parity_tests.sh --suite node-suite --module globals --filter typedarray-own-propertiescargo fmt --all -- --check./scripts/check_file_size.shgit diff --check HEADcargo check -p perry-runtime -p perry-codegen(passed earlier in the slice with existing warnings; not rerun after the final no-conflict rebase because unrelated release builds were active in other worktrees)Known Limitations / Non-Goals