-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add Object::define_own_property() #228
Conversation
This commit introduces the NONE, READ_ONLY, DONT_ENUM and DONT_DELETE property attributes.
79249e1
to
fefd6eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -44,6 +45,13 @@ extern "C" { | |||
key: *const Name, | |||
value: *const Value, | |||
) -> MaybeBool; | |||
fn v8__Object__DefineOwnProperty( | |||
object: &Object, | |||
context: *const Context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would swear I commented here, but my comment seems to be nowhere...
It's not necessary to unwrap Local to a raw pointer before passing them as a function argument from Rust to C++.
If possible, try to be consistent between the extern "C"
declarations on the C++ vs Rust side, which is lacking here:
fn v8__Object__DefineOwnProperty(object: &Object, context: *const Context, ...) -> MaybeBool;
MaybeBool v8__Object__DefineOwnProperty(v8::Object& self, v8::Local<v8::Context> context, ...);
I know it's probably copypasta but let's start somewhere.
(cc @ry, @bartlomieju).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I copied it from create_data_property(). I'll see if I have time today to do a (general) clean up.
Also
Template::set_with_attr()
and the NONE, READ_ONLY, DONT_ENUM and DONT_DELETEproperty attributes.