-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix prototype chains being broken on the JS side (#42) #44
base: master
Are you sure you want to change the base?
Conversation
@Redfire75369 I'm not sure if the failing lint is caused by the changes in this PR:
|
@@ -12,7 +12,7 @@ pub mod console; | |||
pub mod encoding; | |||
#[cfg(feature = "fetch")] | |||
pub mod fetch; | |||
mod file; | |||
pub mod file; |
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 think this is causing clippy warning, probably it only applies to externally visible structs.
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.
In general, the use of ClassDefinition::parent_class_info
should be moved over to ClassDefinition::parent_proto
due to the changes in 8ecaf4c, and in non-proc macro code, the paths for types like Context
and Local
should be use
d if needed and inserted directly, instead of using qualified paths like crate::Context
or crate::Local
.
pub class: &'static NativeClass, | ||
pub constructor: *mut JSFunction, | ||
pub prototype: *mut JSObject, |
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.
pub class: &'static NativeClass, | |
pub constructor: *mut JSFunction, | |
pub prototype: *mut JSObject, | |
class: &'static NativeClass, | |
constructor: *mut JSFunction, | |
prototype: *mut JSObject, |
fn parent_class_info(_: &Context) -> Option<(&'static NativeClass, Local<*mut JSObject>)> { | ||
None | ||
} | ||
|
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.
With the change in 8ecaf4c, ClassDefinition::parent_proto
should be used instead, so this can be removed. Other uses/definitions will have to be changed accordingly.
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'll rebase on that commit and fix the code accoredingly.
|
||
#[doc(hidden)] | ||
pub const fn __ion_self_as_parent_class_info( | ||
_cx: &crate::Context, | ||
) -> Option<(&'static NativeClass, crate::Local<*mut JSObject>)> { | ||
None | ||
} |
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.
The function name should probably be something more like __ion_native_parent_proto
, to match with ClassDefinition::parent_proto
.
This change fixes #42.