-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
LibJS+LibWeb: Implement WebAssembly Native Errors #15248
LibJS+LibWeb: Implement WebAssembly Native Errors #15248
Conversation
This patch adds the WebAssembly CompileError, RuntimeError and LinkError who are defined to be native errors like TypeError for example and exposes them on the WebAssembly object.
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.
There's no reason whatsoever for these errors to live in LibJS. In fact, if anything that doesn't have a spec on tc39.es needs to exist in LibJS, that's an architectural issue we need to solve. (console excluded, and there's one HTML spec data member somewhere and that's already annoying)
Here's the spec you'll want to look at and implement in LibWeb: https://webassembly.github.io/spec/js-api/#error-objects
Ah I wasn't aware of the strict spec isolation (but it makes a whole lot of sense obviously). Sadly I don't really know where to begin with changing the architecture to support non LibJS native errors. |
You can look at how the various looks like they're just |
These are different though and explicitly not platform objects, only things defined via WebIDL are. They implement the NativeError object structure from ES, as described in the spec I linked. You might be able to use the existing |
Right, I tried using However implementing
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This has conflicts. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions! |
This pull request adds the CompileError, RuntimeError and LinkError native errors and exposes them on the WebAssembly object.
Initially I tried defining the errors outside LibJS, this however is non trivial as both we and the spec rely (?) on intrinsics knowing about them.