feat: expose inspector inspected objects - #2039
Open
satouriko wants to merge 1 commit into
Open
Conversation
V8's inspector keeps embedder-selected values in a session-owned history that powers the $0-$4 command-line API, but rusty_v8 did not expose Inspectable or addInspectedObject. Rust and C++ bindings: - add InspectableImpl and an owning Inspectable wrapper - bridge get() through callback, handle, and context scopes - transfer the C++ wrapper into V8 while keeping the Rust implementation in a separate allocation - drop the Rust implementation when V8 destroys or evicts the wrapper Tests: - verify $0 resolves an embedder-provided value - verify eviction drops the Rust implementation 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 (288 passed)
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.
Closes #2034.
Summary
Expose V8 Inspector's
V8InspectorSession::InspectableandaddInspectedObjectAPIs to Rust embedders, allowing embedder-selected valuesto appear in the Inspector Console as
$0through$4.InspectableImpland an owningInspectablewrapperget()unique_ptr$0round-trip behavior and Rust-side cleanup on evictionTesting
cargo fmt --checkclang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.hV8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo clippy --all-targets --locked -- -D clippy::allV8_FROM_SOURCE=1 LIBCLANG_PATH=/usr/lib/llvm-19/lib cargo nextest run --all-targets --locked(288 passed)