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

Commit d72a4c5

Browse files
committed
Convert to ref.null and ref.func correctly
1 parent 947f228 commit d72a4c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

document/js-api/index.bs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,14 @@ Assert: |type| is not [=𝗂𝟨𝟦=].
836836

837837
<div algorithm>
838838
For <dfn>allocating a host address</dfn> for a value |v|, perform the following steps:
839+
1. If |v| is null,
840+
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.
846+
1. Return [=ref.func=] |funcaddr|.
839847
1. Let |map| be the [=surrounding agent=]'s associated [=host value cache=].
840848
1. If a [=host address=] |hostaddr| exists such that |map|[|hostaddr|] is the same as |v|,
841849
1. Return [=ref.host=] |hostaddr|.

0 commit comments

Comments
 (0)