Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 4e28b9b

Browse files
committed
fixup! [js-api] Add support for exceptions.
1 parent 3101d57 commit 4e28b9b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

document/js-api/index.bs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
402402
1. [=list/Append=] |externtable| to |imports|.
403403
1. If |externtype| is of the form [=externtype/tag=] |attribute| <var ignore>functype</var>,
404404
1. Assert: |attribute| is [=tagtype/attribute/exception=].
405-
1. If |v| does not [=implement=] {{Exception}}, throw a {{LinkError}} exception.
405+
1. If |v| does not [=implement=] {{Tag}}, throw a {{LinkError}} exception.
406406
1. Let |tag| be |v|.\[[Address]].
407407
1. Let |extern| be the [=external value=] [=external value/tag=] |tag|.
408408
1. [=list/Append=] |extern| to |imports|.
@@ -443,7 +443,7 @@ The verification of WebAssembly type requirements is deferred to the
443443
1. Assert: |attribute| is [=tagtype/attribute/exception=].
444444
1. Assert: |externval| is of the form [=external value/tag=] |tagaddr|.
445445
1. Let [=external value/tag=] |tagaddr| be |externval|.
446-
1. Let |exception| be [=create an Exception object|a new Exception object=] created from |tagaddr|.
446+
1. Let |exception| be [=create a Tag object|a new Tag object=] created from |tagaddr|.
447447
1. Let |value| be |exception|.
448448
1. Let |status| be ! [=CreateDataProperty=](|exportsObject|, |name|, |value|).
449449
1. Assert: |status| is true.
@@ -1205,7 +1205,7 @@ The <dfn method for="Tag">type()</dfn> method steps are:
12051205
1. Let |idlParameters| be «».
12061206
1. [=list/iterate|For each=] |type| of |parameters|,
12071207
1. [=list/Append=] [$FromValueType$](|type|) to |idlParameters|.
1208-
1. Return «[ "{{ExceptionType/parameters}}" → |idlParameters| ]».
1208+
1. Return «[ "{{TagType/parameters}}" → |idlParameters| ]».
12091209

12101210
</div>
12111211

@@ -1228,7 +1228,7 @@ To <dfn>create a RuntimeException object</dfn> from a [=tag address=] |tagAddres
12281228
of WebAssembly values |payload|, perform the following steps:
12291229

12301230
1. Let |store| be the [=surrounding agent=]'s [=associated store=].
1231-
1. Let |types| be [=exception_parameters=](|store|, |tagAddress|).
1231+
1. Let |types| be [=tag_parameters=](|store|, |tagAddress|).
12321232
1. Assert: |types|'s [=list/size=] is |payload|'s [=list/size=].
12331233
1. [=list/iterate|For each=] |value| and |resultType| of |payload| and |types|, paired linearly,
12341234
1. Assert: |value|'s type matches |resultType|.
@@ -1242,16 +1242,16 @@ of WebAssembly values |payload|, perform the following steps:
12421242
<div algorithm>
12431243

12441244
The <dfn constructor for=RuntimeException
1245-
lt="RuntimeException(exceptionType, payload)">new RuntimeException(|exceptionTag|, |payload|)</dfn>
1245+
lt="RuntimeException(exceptionTag, payload)">new RuntimeException(|exceptionTag|, |payload|)</dfn>
12461246
constructor steps are:
12471247

1248-
1. Let |types| be [=exception_parameters=](|exceptionTag|.\[[Address]]).
1248+
1. Let |types| be [=tag_parameters=](|exceptionTag|.\[[Address]]).
12491249
1. If |types|'s [=list/size=] is not |payload|'s [=list/size=],
12501250
1. Throw a {{TypeError}}.
12511251
1. Let |wasmPayload| be « ».
12521252
1. [=list/iterate|For each=] |value| and |resultType| of |payload| and |types|, paired linearly,
12531253
1. [=list/Append=] ? [=ToWebAssemblyValue=](|value|, |resultType|) to |wasmPayload|.
1254-
1. Set **this**.\[[Type]] to |exceptionType|.\[[Address]].
1254+
1. Set **this**.\[[Type]] to |exceptionTag|.\[[Address]].
12551255
1. Set **this**.\[[Payload]] to |wasmPayload|.
12561256

12571257
</div>
@@ -1285,7 +1285,7 @@ The <dfn>JavaScript exception tag</dfn> is a [=tag address=] reserved by this
12851285
specification to distinguish exceptions originating from JavaScript.
12861286

12871287
For any [=associated store=] |store|, the result of
1288-
[=exception_parameters=](|store|, [=JavaScript exception tag=]) must be « [=externref=] ».
1288+
[=tag_parameters=](|store|, [=JavaScript exception tag=]) must be « [=externref=] ».
12891289

12901290
Issue: Should it be possible for `br_on_exn` to extract the payload from an exception with this tag?
12911291

0 commit comments

Comments
 (0)