Skip to content

fix(runtime): classify buffer-backed Uint8Array misses (#9347) - #9710

Closed
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9347-typed-array-buffer-audit
Closed

fix(runtime): classify buffer-backed Uint8Array misses (#9347)#9710
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9347-typed-array-buffer-audit

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

  • recognize Perry's BufferHeader-backed Uint8Array representation in reflected %TypedArray%.prototype descriptor getters and Node-API typed-array queries
  • preserve real view offsets, stable backing ArrayBuffer identity, and canonical data spans for those APIs
  • route Reflect.set and extensibility checks through the buffer-aware typed-array owner path, keep ordinary properties in one side table, and prune that address-keyed state during buffer GC
  • add Node parity coverage plus focused Node-API and GC tests

Before this change, calling the intrinsic length, byteLength, byteOffset, or buffer getter with a Uint8Array receiver threw TypeError; Node-API reported the same value as not being a typed array; and preventExtensions/Reflect.set either reported stale extensibility or lost ordinary-property writes. The Int32Array controls already behaved correctly.

Addresses #9347.

Tests

No version bump is included.

@proggeramlug
proggeramlug force-pushed the fix/9347-typed-array-buffer-audit branch from c078beb to 4bf3641 Compare September 4, 2026 09:21
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 52400391-b1e6-4491-b3da-73bc0cb6096f

📥 Commits

Reviewing files that changed from the base of the PR and between 75b886a and 4bf3641.

📒 Files selected for processing (13)
  • changelog.d/9710-typed-array-buffer-miss-consumers.md
  • crates/perry-runtime/src/buffer/header.rs
  • crates/perry-runtime/src/buffer/own_props.rs
  • crates/perry-runtime/src/gc/tests/buffer_side_tables.rs
  • crates/perry-runtime/src/node_api_host/buffers.rs
  • crates/perry-runtime/src/node_api_host/tests.rs
  • crates/perry-runtime/src/object/global_this/typed_array.rs
  • crates/perry-runtime/src/object/object_ops_frozen.rs
  • crates/perry-runtime/src/object/reflect_support.rs
  • crates/perry-runtime/src/proxy.rs
  • crates/perry-runtime/src/typedarray_props.rs
  • test-files/test_gap_9347_uint8array_extensibility.ts
  • test-files/test_gap_9347_uint8array_reflected_accessors.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9714 (rebase-merged, so your commit keeps its authorship). Thanks!

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