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
Copy file name to clipboardExpand all lines: document/js-api/index.bs
+7-7
Original file line number
Diff line number
Diff line change
@@ -1170,7 +1170,7 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [
1170
1170
1. Let |args| be the result of [=coerce JavaScript arguments|coercing arguments=] (|functype|,|argValues|).
1171
1171
1. Let (|store|, |ret|) be the result of [=func_invoke=](|store|, |funcaddr|, |args|).
1172
1172
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
1173
-
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>.
1173
+
1. If |ret| is [=error=], throw an exception. This exception must be a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by <a href="#errors">the WebAssembly error mapping</a>.
1174
1174
1. If |ret| is [=THROW=][=ref.exn=] |exnaddr|, then:
1175
1175
1. Let |tagaddr| be [=exn_tag=](|store|, |exnaddr|).
1176
1176
1. Let |payload| be [=exn_read=](|store|, |exnaddr|).
@@ -1437,7 +1437,7 @@ interface Suspending {
1437
1437
1. Add an entry mapping |ec| to [=active=] in |map|.
1438
1438
1. Let (|store|, |result|) be the result of [=func_invoke=](|store|, |funcaddr|, |args|).
1439
1439
1. Assert: If control reaches here, we have done waiting for suspended imports.
1440
-
1. If the entry for |ec| in |map| is not [=active=] then throw a WebAssembly {{RuntimeError}} exception. Otherwise, remove the entry for |ec| from [=map=].
1440
+
1. If the entry for |ec| in |map| is not [=active=] then throw a WebAssembly {{SuspendError}} exception. Otherwise, remove the entry for |ec| from [=map=].
1441
1441
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
1442
1442
1. If |result| is [=error=], throw a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by <a href="#errors">the WebAssembly error mapping</a>.
1443
1443
1. Otherwise, if |result| is of the form [=throw=] exnaddr,
@@ -1476,7 +1476,7 @@ To <dfn>create a suspending function</dfn> from a JavaScript function |func|, wi
1476
1476
1. Let |async_context| be the [=surrounding agent=]'s [=running execution context=].
1477
1477
1. Let |map| be the [=surrounding agent=]'s associated [=Execution Context Status map=].
1478
1478
1. If the entry for |async_context| in |map| is not [=active=], then:
1479
-
1. Perform [=throw a JavaScript exception=] with a {{RuntimeError}} exception.
1479
+
1. Perform [=throw a JavaScript exception=] with a {{SuspendError}} exception.
1480
1480
1. [=Prepare to run script=] with |relevant settings|.
1481
1481
1. [=Prepare to run a callback=] with |stored settings|.
1482
1482
1. Let [|parameters|] → [|resultTypes|] be |functype|.
@@ -1495,7 +1495,7 @@ To <dfn>create a suspending function</dfn> from a JavaScript function |func|, wi
1495
1495
1. Note: We only invoke [$Await$] if the call to |func| has returned a Promise object.
1496
1496
1. Note: This will suspend both this algorithm, and the WebAssembly function being invoked by the [=evaluate a Promising function=] algorithm. On return, |ret| will be either a normal completion or a throw completion.
1497
1497
1. If the entry for |async_context| in |map| is not [=paused=] then:
1498
-
1. Perform [=throw a JavaScript exception=] with a {{RuntimeError}}.
1498
+
1. Perform [=throw a JavaScript exception=] with a {{SuspendError}}.
1499
1499
1. Otherwise, set the entry to [=active=].
1500
1500
1. If |awaitResult|.\[[Type]] is <emu-const>throw</emu-const>, then:
1501
1501
1. Let |type|, |payload| and |opaqueData| be the result of [=coerce a JavaScript exception|coercing the JavaScript exception=] |ret|.\[[Value]].
@@ -1807,19 +1807,19 @@ To <dfn>get the JavaScript exception tag</dfn>, perform the following steps:
1807
1807
1808
1808
<h3 id="error-objects">Error Objects</h3>
1809
1809
1810
-
WebAssembly defines the following Error classes: <dfn exception>CompileError</dfn>, <dfn exception>LinkError</dfn>, and <dfn exception>RuntimeError</dfn>.
1810
+
WebAssembly defines the following Error classes: <dfn exception>CompileError</dfn>, <dfn exception>LinkError</dfn>, <dfn exception>RuntimeError</dfn>, and <dfn exception>SuspendError</dfn>.
1811
1811
1812
1812
<div algorithm="create the WebAssembly namespace object">
1813
1813
When the [=namespace object=] for the {{WebAssembly}} namespace is [=create a namespace object|created=], the following steps must be run:
1814
1814
1815
1815
1. Let |namespaceObject| be the [=namespace object=].
1816
-
1. [=list/iterate|For each=] |error| of « "CompileError", "LinkError", "RuntimeError" »,
Note: This defines {{CompileError}}, {{LinkError}}, and {{RuntimeError}} classes on the {{WebAssembly}} namespace, which are produced by the APIs defined in this specification.
1822
+
Note: This defines {{CompileError}}, {{LinkError}}, {{RuntimeError}}, and {{SuspendError}} classes on the {{WebAssembly}} namespace, which are produced by the APIs defined in this specification.
1823
1823
They expose the same interface as native JavaScript errors like {{TypeError}} and {{RangeError}}.
1824
1824
1825
1825
Note: It is not currently possible to define this behavior using Web IDL.
0 commit comments