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

Improve error handling for toStrict #129

Merged
merged 1 commit into from
May 27, 2024
Merged

Improve error handling for toStrict #129

merged 1 commit into from
May 27, 2024

Conversation

arduano
Copy link
Collaborator

@arduano arduano commented May 9, 2024

Improve error handling for toStrict

when calling toStrict, there was no try/catch for propagating the error back to Rust correctly. However, call_js_function didn't have the ability to correctly pass in the current this object to the function, so I made another function to handle it. In the future we should do a full cleanup of helper functions in general.


Stack created with Sapling. Best reviewed with ReviewStack.

};
Ok(strict_nix_value)
}

pub fn call_applied_js_function<'s>(
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure what "applied function" means. Does it mean "instance method"? If so, could you please rename to:

pub fn call_js_instance_mehod<'s>(

If not, could you add a comment explaining what an "applied" function is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I had a bit of a mind blank with this one. You can .apply on functions in js, but yeah this is just an instance method.

when calling `toStrict`, there was no try/catch for propagating the error back to Rust correctly. However, `call_js_function` didn't have the ability to correctly pass in the current `this` object to the function, so I made another function to handle it. In the future we should do a full cleanup of helper functions in general.
@urbas urbas merged commit 86ab64c into master May 27, 2024
3 checks passed
@urbas urbas deleted the pr129 branch May 27, 2024 09:17
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.

None yet

2 participants