Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement JSObject::set_property and ::set_property_at_index #15

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Oct 5, 2023

These patches implement JSObject::set_property and ::set_property_at_index by using sys::JSObjectSetProperty and sys::JSObjectSetPropertyAtIndex.

It's based on #14. #14 should ideally be merged before.

Hywan added 3 commits October 5, 2023 08:53
This patch removes the `&JSContext` argument from
`JSObject::call_as_function`. All the other methods adopt this style,
and I believe it makes total sense.
This patch implements `JSObject::set_property`. Behind the scene, it
uses `sys::JSOBjectSetProperty`.

I'm not familiar with the `attributes` argument
(`sys::JSPropertyAttributes`). I've decided to set it to a default value
of 0 for now. Creating a new `JSObject::set_property_with_attributes`
method later could be a solution.
This patch implements `JSObject::set_property_at_index`. Behind the scene, it
uses `sys::JSOBjectSetPropertyAtIndex`.
@waywardmonkeys waywardmonkeys merged commit 2b98c24 into endoli:main Oct 5, 2023
@Hywan
Copy link
Contributor Author

Hywan commented Oct 5, 2023

Thanks for the fast merge.

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