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
+32-15Lines changed: 32 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1040,12 +1040,12 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
1040
1040
1. [=list/Append=][=ToWebAssemblyValue=](|arg|, |t|) to |args|.
1041
1041
1. Set |i| to |i| + 1.
1042
1042
1. Let (|store|, |ret|) be the result of [=func_invoke=](|store|, |funcaddr|, |args|).
1043
-
1. Note: The expectation is that [=func_invoke=] will be updated to return (|store|, <var ignore>val</var>* | [=error=] | (exception |exntag| |payload|)).
1043
+
1. Note: The expectation is that [=func_invoke=] will be updated to return (|store|, <var ignore>val</var>* | [=error=] | (exception |exntag| |payload| |opaqueData|)).
1044
1044
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
1045
1045
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>.
1046
-
1. If |ret| is exception |exntag| |payload|, then
1047
-
1. If |exntag| is the[=JavaScript exception tag=], then
1048
-
1. Let « [=ref.extern=] |externaddr| » be |payload|.
1046
+
1. If |ret| is exception |exntag| |payload| |opaqueData|, then
1047
+
1. If |opaqueData| is not[=ref.null=][=externref=],
1048
+
1. Let « [=ref.extern=] |externaddr| » be |opaqueData|.
1049
1049
1. Throw the result of [=retrieving an extern value=] from |externaddr|.
1050
1050
1. Let |exception| be [=create an Exception object|a new Exception=] for |exntag| and |payload|.
1051
1051
1. Throw |exception|.
@@ -1107,8 +1107,9 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
1107
1107
1. Let |payload| be |v|.\[[Payload]].
1108
1108
1. Otherwise,
1109
1109
1. Let |type| be the [=JavaScript exception tag=].
1110
-
1. Let |payload| be [=ToWebAssemblyValue=](|v|, [=externref=]).
1111
-
1. [=WebAssembly/Throw=] with |type| and |payload|.
1110
+
1. Let |payload| be « ».
1111
+
1. Let |opaqueData| be [=ToWebAssemblyValue=](|v|, [=externref=])
1112
+
1. [=WebAssembly/Throw=] with |type|, |payload| and |opaqueData|.
1112
1113
1. Otherwise, return |result|.\[[Value]].
1113
1114
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1114
1115
1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|).
@@ -1258,20 +1259,25 @@ Advisement: This method is only expected to be implemented or shipped when both
The <dfn attribute for="Exception">stack</dfn> getter steps are:
1343
+
1344
+
1. Return **this**.\[[Stack]].
1345
+
1346
+
</div>
1347
+
1329
1348
<h4 id="js-exceptions">JavaScript exceptions</h4>
1330
1349
1331
1350
The <dfn>JavaScript exception tag</dfn> is a [=tag address=] reserved by this
1332
1351
specification to distinguish exceptions originating from JavaScript.
1333
1352
1334
1353
For any [=associated store=] |store|, the result of
1335
-
[=tag_parameters=](|store|, [=JavaScript exception tag=]) must be « [=externref=] ».
1336
-
1337
-
Issue: Should it be possible for `catch <JS-exception-tag>` to extract the payload from an exception with this tag?
1354
+
[=tag_parameters=](|store|, [=JavaScript exception tag=]) must be « ».
1338
1355
1339
1356
<div algorithm>
1340
1357
1341
-
To <dfn for=WebAssembly>throw</dfn> with a [=tag address=] |type| and matching [=list=] of WebAssembly values |payload|, perform the following steps:
1358
+
To <dfn for=WebAssembly>throw</dfn> with a [=tag address=] |type|, a matching [=list=] of WebAssembly values |payload|, and an [=externref=] |opaqueData|, perform the following steps:
1342
1359
1343
1360
1. Unwind the stack until reaching the *catching try block* given |type|.
1344
-
1. Invoke the catch block with |payload|.
1361
+
1. Invoke the catch block with |payload| and |opaqueData|.
1345
1362
1346
1363
Note: This algorithm is expected to be moved into the core specification.
0 commit comments