Fix exotic get_own_property descriptor presence flags#2
Merged
Conversation
Set QuickJS JS_PROP_HAS_* bits when returning descriptors from exotic class get_own_property hooks, preventing descriptor consumers such as Object.keys() and Object.getOwnPropertyDescriptor() from reading invalid descriptor state. Extend the handwritten exotic class test to cover enumerable own property names, Object.keys(), writable data descriptors, and accessor descriptors.
There was a problem hiding this comment.
Pull request overview
This PR fixes QuickJS property descriptor presence handling for exotic classes by ensuring JS_PROP_HAS_* bits are set when returning property descriptors from exotic_get_own_property, so descriptor consumers (e.g. Object.keys(), Object.getOwnPropertyDescriptor()) see valid/consistent descriptor shapes. It also extends the existing exotic-class test to cover enumerable own property names, Object.keys(), writable data descriptors, and accessor descriptors.
Changes:
- Set
JS_PROP_HAS_GET/JS_PROP_HAS_SETfor get/set descriptors andJS_PROP_HAS_VALUEfor data descriptors returned from the exoticget_own_propertyhook. - Extend the exotic-class test to include an accessor property and additional descriptor/key enumeration assertions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/src/class/ffi.rs | Updates descriptor flag construction for exotic get_own_property results. |
| core/src/class.rs | Extends exotic-class test coverage for keys and property descriptors (data + accessor). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Set QuickJS JS_PROP_HAS_* bits when returning descriptors from exotic class get_own_property hooks, preventing descriptor consumers such as Object.keys() and Object.getOwnPropertyDescriptor() from reading invalid descriptor state.
Extend the handwritten exotic class test to cover enumerable own property names, Object.keys(), writable data descriptors, and accessor descriptors.