-
Notifications
You must be signed in to change notification settings - Fork 70
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
refactor(crate): update to neon 0.7, closes #64 #67
base: master
Are you sure you want to change the base?
refactor(crate): update to neon 0.7, closes #64 #67
Conversation
@lucasfernog nice one. Hey @GabrielCastro, are there any blockers to getting this merged? I'm looking at updating some old libs to new neon, but neon-serde support is a blocker. Happy to help if there's anything that I can help with here. thanks both! 🙇 |
#[allow(use_debug)] | ||
impl From<Error> for neon::result::Throw { | ||
fn from(err: Error) -> Self { | ||
if let ErrorKind::Js(_) = *err.kind() { | ||
return neon::result::Throw; | ||
}; | ||
let msg = format!("{:?}", err); | ||
unsafe { | ||
neon_runtime::error::throw_error_from_utf8(msg.as_ptr(), msg.len() as i32); | ||
neon::result::Throw | ||
} | ||
} | ||
} | ||
|
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.
@joshuef Thanks for doing the work of upgrading. I just started using this. Not having this trait means we can't use the ?
operator for handling Result types. Is there a reason we cannot have this trait?
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.
It's explained here: https://docs.rs/neon/0.7.1/neon/result/struct.Throw.html
Kinda unfortunate though, breaks the export!
macro. It uses ?
and should be changed to handle errors properly. Couldn't tell you exactly how though.
I am also in need of this, except using the N-API features, specified as such:
Is there any good way of exposing the features in this crate? Currently I've forked this and am hard coding the toml change, but it'd be nice to use the proper crate. |
No description provided.