-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
allow zig js host functions to return JSError #15120
Conversation
❌ @nektro, your commit 891daa2 has 3 failures in test/js/bun/http/serve.test.ts - 1 failing on 🍎 x64test/js/web/fetch/fetch.tls.test.ts - 1 failing on 🍎 aarch64test/regression/issue/ctrl-c.test.ts - 1 failing on 🍎 aarch64 |
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 actually be annotating every function with bun.JSError!
? i think my solution to this in dave/more-bake is better, since it doesnt include the catch
control flow on functions that don't return an error
nearly every function annotated will be taking advantage of it eventually and unless there's a noticeable perf effect then the consistency makes the function's purpose very clear at a glance a big motivator for this project is to make the code interacting with these values as predictable as possible to interact with so that it becomes hard or impossible to introduce certain kinds of bugs |
if we want all of these functions to have the explicit annotation, it should be this is why i asked to wait a day for my branch to finish, as i'm nearly close to merging it. was this blocking something else? |
in a couple more stages i think it would make more sense for edit: in a few more after that |
JSError, | ||
// XXX: This is temporary! meghan will remove this soon | ||
OutOfMemory, |
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 we should consider keeping this here and rename error.JSError
to error.ThrownException
or something similar
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.
yeah there's many followups ahead of this
progress towards zig JSValue stability and safety in #159
more followups to come