This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Commit d399b9e
authored
Expose the JavaScript Exception tag and allow importing it (#269)
As discussed in #202
The JS tag was added to the JS API spec in #301, but it is not observable. This change
exposes it on the WebAssembly namespace, allowing it to be imported into wasm modules.
This allows wasm modules to explicitly extract the thrown JS objects as externrefs from the
caught exrefs, and also to throw fresh exceptions with externref payloads that will propagate
into JS and can be caught as bare JS objects not wrapped in a WebAssembly.Exception.
It also places the restriction that WebAssembly.Exception objects cannot be created with
the JS tag, because it would result in ambiguity or asymmetry when such objects unwind
from JS into wasm and back out.1 parent c97651f commit d399b9e
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
| |||
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
508 | 515 | | |
509 | 516 | | |
510 | 517 | | |
| |||
1306 | 1313 | | |
1307 | 1314 | | |
1308 | 1315 | | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
1309 | 1319 | | |
1310 | 1320 | | |
1311 | 1321 | | |
| |||
0 commit comments