Skip to content

Conversation

@tsyesika
Copy link

@tsyesika tsyesika commented Jul 7, 2021

This clears up two issues in the overview document surrounding the usage of WebAssembly.Function, these are:

  • What behaviour should occur if you pass a WebAssembly.Function object to the WebAssembly.Function constructor. (discussed here: Passing a WasmExportedFunction to new WebAssembly.Function #13)
  • Clarify that the same behaviour should occur when calling the function as when calling an exported function (e.g. the ToJSValue should be applied to arguments when called, etc.)


* The constructor for this class can be used to explicitly construct Wasm exported functions, closing a gap in the current API in that does not provide a way for JavaScript to put a plain JS function into a table (while the same is possible from inside Wasm).

* The constructor should not allow for passing a `WebAssembly.Function` object in, in such situations a `TypeError` should be raised.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think throwing is not the right resolution here, see my latest comment on #13.

@wingo
Copy link
Contributor

wingo commented Sep 9, 2021

cc @Ms2ger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants