Skip to content

Commit fe35784

Browse files
authored
Update index.bs
Clean up throwing exceptions from JS (a little bit)
1 parent 0b8f557 commit fe35784

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

document/js-api/index.bs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not
12511251
1. If |result|.\[[Type]] is <emu-const>normal</emu-const>, then:
12521252
1. Return the result of performing [=coerce a JavaScript return=] on |resultTypes| and |ret|.
12531253
1. If |result|.\[[Type]] is <emu-const>throw</emu-const>, then:
1254-
1. Perform [=throw a JavaScript exception|throw the JavaScript exception=] |result|.\[[Value]].
1254+
1. Perform [=throw a JavaScript exception|throw the JavaScript exception=] on |result|.\[[Value]].
12551255
1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|).
12561256
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
12571257
1. Return |funcaddr|.
@@ -1439,7 +1439,7 @@ interface Suspending {
14391439
1. Assert: If control reaches here, we have done waiting for suspended imports.
14401440
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=].
14411441
1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
1442-
1. If |result| 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>.
1442+
1. If |result| is [=error=], throw a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by <a href="#errors">the WebAssembly error mapping</a>.
14431443
1. Otherwise, if |result| is of the form [=throw=] exnaddr,
14441444
1. [=Reject=] |promise| with |result|.
14451445
1. Otherwise,
@@ -1476,8 +1476,7 @@ To <dfn>create a suspending function</dfn> from a JavaScript function |func|, wi
14761476
1. Let |async_context| be the [=surrounding agent=]'s [=running execution context=].
14771477
1. Let |map| be the [=surrounding agent=]'s associated [=Execution Context Status map=].
14781478
1. If the entry for |async_context| in |map| is not [=active=], then:
1479-
1. Let |type|, |payload| and |opaqueData| be the result of [=coerce a JavaScript exception|coercing the JavaScript exception=] {{RuntimeError}}.
1480-
1. [=WebAssembly/Throw=] with |type|, |payload| and |opaqueData|.
1479+
1. Perform [=throw a JavaScript exception=] with a {{RuntimeError}} exception.
14811480
1. [=Prepare to run script=] with |relevant settings|.
14821481
1. [=Prepare to run a callback=] with |stored settings|.
14831482
1. Let [|parameters|][|resultTypes|] be |functype|.
@@ -1496,8 +1495,7 @@ To <dfn>create a suspending function</dfn> from a JavaScript function |func|, wi
14961495
1. Note: We only invoke [$Await$] if the call to |func| has returned a Promise object.
14971496
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.
14981497
1. If the entry for |async_context| in |map| is not [=paused=] then:
1499-
1. Let |type|, |payload| and |opaqueData| be the result of [=coerce a JavaScript exception|coercing the JavaScript exception=] {{RuntimeError}}.
1500-
1. [=WebAssembly/Throw=] with |type|, |payload| and |opaqueData|.
1498+
1. Perform [=throw a JavaScript exception=] with a {{RuntimeError}}.
15011499
1. Otherwise, set the entry to [=active=].
15021500
1. If |awaitResult|.\[[Type]] is <emu-const>throw</emu-const>, then:
15031501
1. Let |type|, |payload| and |opaqueData| be the result of [=coerce a JavaScript exception|coercing the JavaScript exception=] |ret|.\[[Value]].

0 commit comments

Comments
 (0)