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 01f2c6d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 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 @@ -14602,11 +14608,19 @@ Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn
<dfn for="DOMException">message</dfn>, both [=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 01f2c6d

Please sign in to comment.