-
Notifications
You must be signed in to change notification settings - Fork 318
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 v8::Value::InstanceOf bindings #879
Conversation
I am not in favor of implementing deref_mut for Local handles. |
src/handle.rs
Outdated
impl<'s, T> DerefMut for Local<'s, T> { | ||
fn deref_mut(&mut self) -> &mut T { | ||
unsafe { self.0.as_mut() } | ||
} | ||
} |
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.
As per @piscisaureus's comment we should remove this
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.
instance_of
requires for T
to be mutable in v8::Local<T>
, hence the deref_mut implementation. I'm not sure how you can do instance_of
on a local handle without this.
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.
Is there a reason the InstanceOf
function is not marked as const
in the c++ api?
Seems counter-intuitive, could this be a mistake in the v8 c++ api?
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.
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.
@piscisaureus please advise
I may well be wrong, but it seems like this binding will be necessary for implementing magic (de)serialiser for FFI-related custom class wrapping ArrayBuffers for passing to native libraries. |
Discussed offline with @littledivy.
|
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
No description provided.