fix: pass flags to v8__ObjectTemplate__SetIndexedPropertyHandler FFI#1994
Draft
popematt wants to merge 1 commit into
Draft
fix: pass flags to v8__ObjectTemplate__SetIndexedPropertyHandler FFI#1994popematt wants to merge 1 commit into
flags to v8__ObjectTemplate__SetIndexedPropertyHandler FFI#1994popematt wants to merge 1 commit into
Conversation
The FFI declaration for `SetIndexedPropertyHandler` omitted the `flags` parameter that the C++ binding accepts, causing any flags set on `IndexedPropertyHandlerConfiguration` (e.g., `NON_MASKING`) to be silently discarded. The named handler's declaration already passes flags correctly—this aligns the indexed handler to match. Added a test that sets `NON_MASKING` on an indexed handler and verifies real indexed elements take priority over the interceptor.
|
|
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.
The FFI declaration for
SetIndexedPropertyHandleromitted theflagsparameter that the C++ binding accepts, causing any flags set onIndexedPropertyHandlerConfiguration(e.g.,NON_MASKING) to be silently discarded. I think it also results in UB because we're calling a C/C++ function with fewer args than expected... and the Rust compiler cannot detect because we correctly called the binding function. The problem is that theextern "C"binding function does not match the actual signature of the C++ function.The named handler's declaration already passes flags correctly—this aligns the indexed handler to match.
Added a test that sets
NON_MASKINGon an indexed handler and verifies real indexed elements take priority over the interceptor.For reference, here is the C++ function that we're trying to match:
rusty_v8/src/binding.cc
Lines 1505 to 1517 in 5d0e31e