Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit 7866056

Browse files
committed
Comments by bnjbvr
1 parent d72a4c5 commit 7866056

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

document/js-api/index.bs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ Note: Implementations may optionally replace the NaN payload with any other NaN
809809
</div>
810810

811811
<div algorithm>
812-
The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|, |error|) coerce a JavaScript value to a [=WebAssembly value=] performs the following steps:
812+
The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|, |error|) coerces a JavaScript value to a [=WebAssembly value=] performs the following steps:
813813

814814

815815
Assert: |type| is not [=𝗂𝟨𝟦=].
@@ -829,7 +829,7 @@ Assert: |type| is not [=𝗂𝟨𝟦=].
829829
1. If |v| is a primitive value but not a symbol or null, throw |error|.
830830
1. Return the result of [=allocating a host address=] for |v|.
831831
1. If |type| is [=anyfunc=],
832-
1. If |v| is not callable or null, throw |error|.
832+
1. If |v| is not an [=Exported function=] or null, throw |error|.
833833
1. Return the result of [=allocating a host address=] for |v|.
834834

835835
</div>
@@ -838,11 +838,8 @@ Assert: |type| is not [=𝗂𝟨𝟦=].
838838
For <dfn>allocating a host address</dfn> for a value |v|, perform the following steps:
839839
1. If |v| is null,
840840
1. Return [=ref.null=].
841-
1. If |v| is callable,
842-
1. If |v| has a \[[FunctionAddress]] internal slot, and therefore is an [=Exported Function=],
843-
1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot.
844-
1. Otherwise,
845-
1. [=Create a host function=] from |v| and let |funcaddr| be the result.
841+
1. If |v| is an [=Exported Function=],
842+
1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot.
846843
1. Return [=ref.func=] |funcaddr|.
847844
1. Let |map| be the [=surrounding agent=]'s associated [=host value cache=].
848845
1. If a [=host address=] |hostaddr| exists such that |map|[|hostaddr|] is the same as |v|,

proposals/reference-types/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ API extensions:
100100
* Any JS object (non-primitive value) or string or symbol or `null` can be passed as `anyref` to a Wasm function, stored in a global, or in a table.
101101
- It may be possible to allow all other non-primitive values as well, depending on details of existing engines.
102102

103-
* Any JS function object or `null` can be passed as `anyfunc` to a Wasm function, stored in a global, or in a table.
103+
* Any Wasm exported function object or `null` can be passed as `anyfunc` to a Wasm function, stored in a global, or in a table.
104104

105105

106106
## Possible Future Extensions

0 commit comments

Comments
 (0)