Add regression test for Object.getOwnPropertyDescriptors with JSG_INSPECT_PROPERTY#6538
Merged
harrishancock merged 1 commit intomainfrom Apr 9, 2026
Conversation
…PECT_PROPERTY Regression test for #4147. Object.getOwnPropertyDescriptors() on a JSG prototype with JSG_INSPECT_PROPERTY used to throw "Illegal invocation" because registerInspectProperty() used SetNativeDataProperty on the prototype. V8 would invoke the native getter callback during descriptor retrieval to produce a data descriptor value, and the callback's HasInstance check would fail because the prototype object is not an instance of the type. Fixed by PR #6003 (c43c98a), which changed registerInspectProperty() to use SetAccessorProperty instead. Assisted-by: Claude
Contributor
|
Good - I can confirm at line 1537 that Now I have a thorough understanding of the PR. This is a straightforward, well-structured regression test that:
The test is correct, follows existing patterns, and has no issues. There are no security, safety, backward compatibility, or code quality concerns. LGTM |
jasnell
approved these changes
Apr 9, 2026
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.
Regression test for #4147.
Object.getOwnPropertyDescriptors() on a JSG prototype with JSG_INSPECT_PROPERTY used to throw "Illegal invocation" because registerInspectProperty() used SetNativeDataProperty on the prototype. V8 would invoke the native getter callback during descriptor retrieval to produce a data descriptor value, and the callback's HasInstance check would fail because the prototype object is not an instance of the type.
Fixed by PR #6003 (c43c98a), which changed registerInspectProperty() to use SetAccessorProperty instead.
Assisted-by: Claude