Skip to content

Commit

Permalink
Merge pull request #440 from WebAssembly/js.func
Browse files Browse the repository at this point in the history
[js-api] Allow exported funcs as any
  • Loading branch information
rossberg authored Sep 21, 2023
2 parents 4ed4eb4 + 8f6f7b9 commit 895e7a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,16 +1156,16 @@ The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|) coerces a JavaScript va
1. Let |i31| [=?=] [$ToInt32$](|v|).
1. Let |u31| be the unsigned integer such that |i31| is [=signed_31=](|i31|).
1. Let |r| be [=ref.i31=] |u31|.
1. Else if |v| is an [=Exported Function=],
1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot.
1. Let |r| be [=ref.func=] |funcaddr|.
1. Else if |v| is an [=Exported GC Object=],
1. Let |objectaddr| be the value of |v|'s \[[ObjectAddress]] internal slot.
1. Let |objectkind| be the value of |v|'s \[[ObjectKind]] internal slot.
1. If |objectkind| is "array",
1. Let |r| be [=ref.array=] |objectaddr|.
1. If |objectkind| is "struct",
1. Let |r| be [=ref.struct=] |objectaddr|.
1. Else if |v| is an [=Exported Function=] and [=match_valtype=](|type|, [=ref=] |null| [=heap-type/func=]),
1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot.
1. Let |r| be [=ref.func=] |funcaddr|.
1. Else,
1. Let |map| be the [=surrounding agent=]'s associated [=host value cache=].
1. If a [=host address=] |hostaddr| exists such that |map|[|hostaddr|] is the same as |v|,
Expand Down

0 comments on commit 895e7a5

Please sign in to comment.