-
Notifications
You must be signed in to change notification settings - Fork 105
Exotic methods support #567
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
base: master
Are you sure you want to change the base?
Conversation
We already have this
richarddd
left a comment
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.
Minor suggestions
|
|
||
| let crate_name = format_ident!("{}", crate_ident()?); | ||
| let class_name = get_class_name(&self_ty); | ||
| let module_name = format_ident!("__impl_exotic_{}__", class_name); |
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.
Should we consolidate this with the one in class to avoid duplication?
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 will rework this I am not satisfied. I think I can use the same trick we are using for the constructor with the double ref specialization.
| match crate::util::catch_unwind(f) { | ||
| Ok(x) => x, | ||
| Err(e) => unsafe { | ||
| self.get_opaque().set_panic(e); | ||
| qjs::JS_Throw(self.as_ptr(), qjs::JS_MKVAL(qjs::JS_TAG_EXCEPTION, 0)); | ||
| -1 | ||
| }, | ||
| } |
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.
This is exact duplicate of handle_panic. Can we use an inner method?
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 can check, dont remember why it was done like that.
Finishes #497