WebAssembly / multi-value

Proposal to add multi-values to WebAssembly
https://webassembly.github.io/multi-value/
Other
70 stars 24 forks source link

Imported JS calls don't handle differing arities. #20

Closed kmiller68 closed 5 years ago

kmiller68 commented 5 years ago

Right now there is a spec assert that host call's iterable result and wasm have the same arity. There's no guarantee this is true. Instead we should probably throw a type error if they don't match.

Alternatively, we could do the more JS-y approach and allow the arity of result to be at least the arity of the expected signature. Although, if we did that we should also allow the arity to be less and call ToWebAssemblyValue(undefined, results[i]) on any results past the end.

I also normalized the wording around what happens when an exception is thrown in the host call does to the surrounding Wasm code. Previously , the wording was a little vague.

Ms2ger commented 5 years ago

@kmiller68 would you be able to rebase this over #21? That should resolve my comment above as well.

kmiller68 commented 5 years ago

Updated to match the new wording. I agree that we don't need the special exception wording since we have rebased against the source spec.

kmiller68 commented 5 years ago

Should I merge this or are we still waiting on @littledan and/or @rossberg?

littledan commented 5 years ago

FYI @Ms2ger will be handling WebAssembly spec editing in going forward, where I was previously involved; no need to wait on my reviews in general.

Ms2ger commented 3 years ago

Tests: https://github.com/web-platform-tests/wpt/pull/20556