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

Add Object::define_own_property() #228

Merged
merged 2 commits into from
Jan 20, 2020

Conversation

bnoordhuis
Copy link
Contributor

Also Template::set_with_attr() and the NONE, READ_ONLY, DONT_ENUM and DONT_DELETE
property attributes.

src/attr.rs Outdated Show resolved Hide resolved
This commit introduces the NONE, READ_ONLY, DONT_ENUM and DONT_DELETE
property attributes.
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit 6efb395 into denoland:master Jan 20, 2020
@bnoordhuis bnoordhuis deleted the object-define_own_property branch January 20, 2020 16:20
@@ -44,6 +45,13 @@ extern "C" {
key: *const Name,
value: *const Value,
) -> MaybeBool;
fn v8__Object__DefineOwnProperty(
object: &Object,
context: *const Context,
Copy link
Member

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).

Copy link
Contributor Author

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.

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.

3 participants