Skip to content

Commit

Permalink
Add DOMException cause
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Sep 2, 2022
1 parent d720ef3 commit 9eb6302
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 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 = "Error";
};

[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 (DOMExceptionOptions or DOMString) options = {});
readonly attribute DOMString name;
readonly attribute DOMString message;
readonly attribute unsigned short code;
Expand Down Expand Up @@ -14602,11 +14608,14 @@ 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, options)"><code>new DOMException(|message|, |options|)</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 |options| is a string, then set [=this=]'s [=DOMException/name=] to |options|.
1. Otherwise,
1. Set [=this=]'s [=DOMException/name=] to |options|["{{DOMExceptionOptions/name}}"].
1. Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |options|).

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

0 comments on commit 9eb6302

Please sign in to comment.