Skip to content

Commit 01f2c6d

Browse files
committed
Add DOMException cause
1 parent d720ef3 commit 01f2c6d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

index.bs

+18-4
Original file line numberDiff line numberDiff line change
@@ -14559,10 +14559,16 @@ The {{DOMException}} type is an [=interface type=] defined by the following IDL
1455914559
fragment:
1456014560

1456114561
<pre class="idl">
14562+
14563+
dictionary DOMExceptionOptions {
14564+
any cause;
14565+
DOMString name;
14566+
};
14567+
1456214568
[Exposed=(Window,Worker),
1456314569
Serializable]
1456414570
interface DOMException { // but see below note about ECMAScript binding
14565-
constructor(optional DOMString message = "", optional DOMString name = "Error");
14571+
constructor(optional DOMString message = "", optional (DOMString or DOMExceptionOptions) nameOrOptions = "Error");
1456614572
readonly attribute DOMString name;
1456714573
readonly attribute DOMString message;
1456814574
readonly attribute unsigned short code;
@@ -14602,11 +14608,19 @@ Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn
1460214608
<dfn for="DOMException">message</dfn>, both [=strings=].
1460314609

1460414610
The
14605-
<dfn constructor for="DOMException" lt="DOMException(message, name)"><code>new DOMException(|message|, |name|)</code></dfn>
14611+
<dfn constructor for="DOMException" lt="DOMException(message, nameOrOptions)">
14612+
<code>new DOMException(|message|, |nameOrOptions|)</code>
14613+
</dfn>
1460614614
constructor steps are:
1460714615

14608-
1. Set [=this=]'s [=DOMException/name=] to |name|.
14609-
1. Set [=this=]'s [=DOMException/message=] to |message|.
14616+
1. Set [=this=]'s [=DOMException/message=] to |message|.
14617+
1. If |nameOrOptions| is a String, set [=this=]'s [=DOMException/name=] to
14618+
|nameOrOptions|.
14619+
1. Else,
14620+
1. If |nameOrOptions|'name is present, set [=this=]'s [=DOMException/name=]
14621+
to |nameOrOptions|'s name, else set [=this=]'s [=DOMException/name=]
14622+
to "Error".
14623+
1. Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |nameOrOptions|).
1461014624

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

0 commit comments

Comments
 (0)