Bug 297134
| Summary: | Exception (JS value) thrown inside WebAssembly using WebAssembly.JSTag is wrapped into WebAssembly.Exception immediately | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | bashorov |
| Component: | WebAssembly | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Major | CC: | webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
bashorov
So as a result,
1. It's observable inside a wasm module as an instance of WebAssembly.Exception instead of thrown JS value.
2. It's not unwrapped when it crosses wasm-js border, so in JS it is also visible as an instance of WebAssembly.Exception instead of thrown JS value.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Yusuke Suzuki
Thanks! This will be fixed in bug 297127
Yusuke Suzuki
*** This bug has been marked as a duplicate of bug 297127 ***
Radar WebKit Bug Importer
<rdar://problem/157875232>
Keith Miller
Are you sure 2 is the case? https://webassembly.github.io/exception-handling/js-api/#call-an-exported-function says it is unwrapped back to the underlying JS value when propagating back through JS. I'm pretty sure the bug in https://github.com/WebKit/WebKit/pull/49130 was due to the opposite; we weren't unwrapping the `WebAssembly.Exception` if it had a JSTag for exported functions if it was created and thrown from wasm i.e. `(throw $JSTag someExternref)`
What's the case you're seeing 1 in?
bashorov
> we weren't unwrapping the `WebAssembly.Exception`
(2) is basically saying the same thing
bashorov
BTW, I don't see any test for (1) in the PR. Could you please check if it's fixed?
bashorov
> What's the case you're seeing 1 in?
Case: an exception is thrown inside wasm using JSTag and caught with JSTag inside wasm.
Actual: in the catch block, we receive an instance of WebAssembly.Exception wrapping the original JS value, e,g, JS Error.
Expected: in the catch block, we receive the original JS value.