Skip to content

Commit

Permalink
fixup! [js-api] Add support for exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Jun 16, 2020
1 parent ba6b577 commit 5604392
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,8 @@ interface Exception {
An {{Exception}} value represents a type of exception.
{{Exception}} values have an <dfn for=Exception>exception tag</dfn>.

The <dfn for=Exception>payload types</dfn> of an {{Exception}} is the [=list=] of types of
The <dfn for=Exception>payload types</dfn> of an {{Exception}} is the [=list=] of types associated
with its [=Exception/exception tag=].


<h4 id="runtime-exceptions">Runtime exceptions</h4>
Expand All @@ -1202,15 +1203,13 @@ A {{RuntimeException}} value represents an [=exnref=] value.
{{RuntimeException}} values have an <dfn for=RuntimeException>internal exception</dfn>, which
is an [=event address=].

Issue: Should it be possible to construct {{RuntimeException}} objects from JavaScript? Only with
the [=JavaScript exception tag=] or also with others? How?
<div algorithm>

The <dfn constructor for=RuntimeException
lt="RuntimeException(exceptionType, payload)">new RuntimeException(|exceptionType|, |payload|)</dfn>
constructor steps are:

1. Let |types| be |exceptionType|'s [=Exception/exception tag=]'s [=list=] of types.
1. Let |types| be |exceptionType|'s [=Exception/payload types=].
1. If |types|'s [=list/size=] is not |payload|'s [=list/size=],
1. Throw a {{TypeError}}.
1. Let |wasmPayload| be « ».
Expand Down

0 comments on commit 5604392

Please sign in to comment.