Skip to content

Commit

Permalink
Add DOMException cause
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Aug 30, 2022
1 parent d720ef3 commit de885da
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -14559,10 +14559,16 @@ The {{DOMException}} type is an [=interface type=] defined by the following IDL
fragment:

<pre class="idl">

dictionary DOMExceptionOptions {
any cause;
DOMString name;
};

[Exposed=(Window,Worker),
Serializable]
interface DOMException { // but see below note about ECMAScript binding
constructor(optional DOMString message = "", optional DOMString name = "Error");
constructor(optional DOMString message = "", optional (DOMString or DOMExceptionOptions) nameOrOptions = "Error");
readonly attribute DOMString name;
readonly attribute DOMString message;
readonly attribute unsigned short code;
Expand Down Expand Up @@ -14598,15 +14604,25 @@ interface DOMException { // but see below note about ECMAScript binding
Note: as discussed in [[#es-DOMException-specialness]], the ECMAScript binding imposes additional
requirements beyond the normal ones for [=interface types=].

Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn> and
<dfn for="DOMException">message</dfn>, both [=strings=].
Each {{DOMException}} object has associated fields:

* its <dfn for="DOMException">name</dfn>, which is [=strings=],
* its <dfn for="DOMException">message</dfn>, which is [=strings=],

The
<dfn constructor for="DOMException" lt="DOMException(message, name)"><code>new DOMException(|message|, |name|)</code></dfn>
<dfn constructor for="DOMException" lt="DOMException(message, nameOrOptions)">
<code>new DOMException(|message|, |nameOrOptions|)</code>
</dfn>
constructor steps are:

1. Set [=this=]'s [=DOMException/name=] to |name|.
1. Set [=this=]'s [=DOMException/message=] to |message|.
1. Set [=this=]'s [=DOMException/message=] to |message|.
1. If |nameOrOptions| is a string, set [=this=]'s [=DOMException/name=] to
|nameOrOptions|.
1. Else,
1. If |nameOrOptions|'name is present, set [=this=]'s [=DOMException/name=]
to |nameOrOptions|'s name, else set [=this=]'s [=DOMException/name=]
to "Error".
1. Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |nameOrOptions|).

The <dfn attribute for="DOMException"><code>name</code></dfn> getter steps are to return
[=this=]'s [=DOMException/name=].
Expand Down

0 comments on commit de885da

Please sign in to comment.