Skip to content

Fix exotic get_own_property descriptor presence flags#2

Merged
yorkie merged 3 commits into
masterfrom
fix/exotic-segfault
Jun 19, 2026
Merged

Fix exotic get_own_property descriptor presence flags#2
yorkie merged 3 commits into
masterfrom
fix/exotic-segfault

Conversation

@yorkie

@yorkie yorkie commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SET for get/set descriptors and JS_PROP_HAS_VALUE for data descriptors returned from the exotic get_own_property hook.
  • 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.

Comment thread core/src/class/ffi.rs
Comment thread core/src/class.rs
Comment thread core/src/class.rs
@yorkie yorkie merged commit bccc15d into master Jun 19, 2026
35 checks passed
@yorkie yorkie deleted the fix/exotic-segfault branch June 19, 2026 16:09
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.

2 participants