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
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -977,6 +977,9 @@ 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,
981
+
1. If the exception is a value that was thrown by JavaScript code called by the Exported Function, throw the exception itself.
982
+
1. Else, throw a {{RuntimeError}} exception.
980
983
1. If |ret| is empty, return undefined.
981
984
1. Otherwise, return [=ToJSValue=](|v|), where |v| is the singular element of |ret|.
982
985
</div>
@@ -1006,7 +1009,9 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
1006
1009
1. Let |hostfunc| be a [=host function=] which performs the following steps when called:
1007
1010
1. Let |result| be the result of [=run a host function|running a host function=] from |func| and |functype|.
1008
1011
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.
1012
+
1. If |result|.\[[Type]] is [=throw=], then:
1013
+
1. Let |exception| be [=ToWebAssemblyValue=](|result|.\[[Value]], [=anyref=]).
1014
+
1. Throw |exception|.
1010
1015
1. Otherwise, return |result|.\[[Value]].
1011
1016
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1012
1017
1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|).
0 commit comments