exception-handling
exception-handling copied to clipboard
Missing s128 type check in the JS API?
If I am reading the spec correctly, s128 types are allowed in tags, whether the tag is defined in a wasm module, or created with the JS API's WebAssembly.Tag
constructor.
But the WebAssembly.Exception
constructor and the WebAssembly.Exception#getArg
function use ToWebAssemblyValue
and ToJSValue
to convert values to/from JS, and this function simply asserts that the type is not s128
. Is a type check missing here, or did I miss something?
What do we do for exported functions that return s128 function return types? Do we disallow it or do we trap? I guess we can do the same for getArg
..
We throw a TypeError when the exported function is called. I agree, we should do something similar here and throw a TypeError if we try to create a WA.Exception
from JS with any s128
in it, or call getArg
on an s128
param (but there may be other s128
params in this case, I think that would be fine as long as we don't access them).