Skip to content

feat: expose inspector value subtype callbacks - #2038

Open
satouriko wants to merge 1 commit into
denoland:mainfrom
satouriko:feat/inspector-value-subtype
Open

feat: expose inspector value subtype callbacks#2038
satouriko wants to merge 1 commit into
denoland:mainfrom
satouriko:feat/inspector-value-subtype

Conversation

@satouriko

Copy link
Copy Markdown

Closes #2032.

Summary

Expose V8 Inspector's valueSubtype and descriptionForValueSubtype
callbacks to Rust embedders.

  • add source-compatible default methods to V8InspectorClientImpl
  • establish the required V8 and Rust callback scopes before invoking client code
  • pass scoped Local<Value> handles to the Rust callbacks
  • return optional descriptions through UniquePtr<StringBuffer>, following the existing ownership pattern
  • add a focused Inspector test covering custom subtype and description metadata while verifying that ordinary objects retain V8's default representation

Testing

  • cargo fmt --check
  • clang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.h
  • V8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo clippy --all-targets --locked -- -D clippy::all
  • V8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo nextest run --all-targets --locked

V8InspectorClient exposes valueSubtype and descriptionForValueSubtype, but rusty_v8 did not forward them, preventing embedders from customizing Runtime.RemoteObject subtype and description metadata.

Rust and C++ bindings:
- add source-compatible default trait methods that receive scoped Local values
- establish V8 and Rust callback scopes before invoking client implementations
- transfer optional StringBuffer results using existing unique-pointer ownership conventions

Tests:
- cover a marked object receiving a custom subtype and description through Runtime.evaluate
- verify ordinary objects retain V8's default representation

Verification:
- cargo fmt --check
- clang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.h
- V8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo clippy --all-targets --locked -- -D clippy::all
- V8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo nextest run --all-targets --locked (287 passed)
@CLAassistant

CLAassistant commented Aug 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Expose V8InspectorClient value subtype callbacks

2 participants