You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: document/js-api/index.bs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -977,6 +977,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
977
977
1. Let (|store|, |ret|) be the result of [=func_invoke=](|store|, |funcaddr|, |argsSeq|).
978
978
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
979
979
1. If |ret| is [=error=], throw an exception. This exception should be a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by <a href="#errors">the WebAssembly error mapping</a>.
980
+
1. If |ret| is an exception, throw a {{RuntimeError}} exception or the exception itself.
980
981
1. If |ret| is empty, return undefined.
981
982
1. Otherwise, return [=ToJSValue=](|v|), where |v| is the singular element of |ret|.
982
983
</div>
@@ -1006,7 +1007,9 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
1006
1007
1. Let |hostfunc| be a [=host function=] which performs the following steps when called:
1007
1008
1. Let |result| be the result of [=run a host function|running a host function=] from |func| and |functype|.
1008
1009
1. Assert: |result|.\[[Type]] is throw or return.
1009
-
1. If |result|.\[[Type]] is [=throw=], then trigger a WebAssembly trap, and propagate |result|.\[[Value]] to the enclosing JavaScript.
1010
+
1. If |result|.\[[Type]] is [=throw=], then:
1011
+
1. Let |exception| be [=ToWebAssemblyValue=](|result|.\[[Value]], [=anyref=]).
1012
+
1. Throw |exception|.
1010
1013
1. Otherwise, return |result|.\[[Value]].
1011
1014
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1012
1015
1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|).
0 commit comments