Skip to content

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

Merged
waywardmonkeys merged 3 commits into
endoli:mainfrom
Hywan:feat-object-set-property
Oct 5, 2023
Merged

feat: Implement JSObject::set_property and ::set_property_at_index#15
waywardmonkeys merged 3 commits into
endoli:mainfrom
Hywan:feat-object-set-property

Conversation

@Hywan
Copy link
Copy Markdown
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
Copy Markdown
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