Skip to content

Commit

Permalink
[js-api] Pass a functype parameter to "create a host function".
Browse files Browse the repository at this point in the history
Fixes #768.
  • Loading branch information
Ms2ger authored and littledan committed Jan 25, 2019
1 parent 9ac3049 commit 421fab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje

Note: The signature is checked by [=instantiate_module=] invoked below.
1. Otherwise,
1. [=Create a host function=] from |v| and let |funcaddr| be the result.
1. [=Create a host function=] from |v| and |functype|, and let |funcaddr| be the result.
1. Let |index| be the number of external functions in |imports|. This value |index| is known as the <dfn>index of the host function</dfn> |funcaddr|.
1. Let |externfunc| be the [=external value=] [=external value|𝖿𝗎𝗇𝖼=] |funcaddr|.
1. [=Append=] |externfunc| to |imports|.
Expand Down Expand Up @@ -901,7 +901,7 @@ Note: [=call an Exported Function|Calling an Exported Function=] executes in the
Note: Exported Functions do not have a \[[Construct]] method and thus it is not possible to call one with the `new` operator.

<div algorithm>
To <dfn>create a host function</dfn> from the JavaScript object |func|, perform the following steps:
To <dfn>create a host function</dfn> from the JavaScript object |func| and type |functype|, perform the following steps:

1. Let |hostfunc| be a [=host function=] which performs the following steps when called:
1. If the signature contains an [=𝗂𝟨𝟦=] (as argument or result), the host function throws a {{TypeError}} when called.
Expand Down

0 comments on commit 421fab1

Please sign in to comment.