@@ -14559,10 +14559,16 @@ The {{DOMException}} type is an [=interface type=] defined by the following IDL
14559
14559
fragment:
14560
14560
14561
14561
<pre class="idl">
14562
+
14563
+ dictionary DOMExceptionOptions {
14564
+ any cause;
14565
+ DOMString name;
14566
+ };
14567
+
14562
14568
[Exposed=(Window,Worker),
14563
14569
Serializable]
14564
14570
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");
14566
14572
readonly attribute DOMString name;
14567
14573
readonly attribute DOMString message;
14568
14574
readonly attribute unsigned short code;
@@ -14598,15 +14604,25 @@ interface DOMException { // but see below note about ECMAScript binding
14598
14604
Note: as discussed in [[#es-DOMException-specialness]], the ECMAScript binding imposes additional
14599
14605
requirements beyond the normal ones for [=interface types=].
14600
14606
14601
- Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn> and
14602
- <dfn for="DOMException">message</dfn>, both [=strings=].
14607
+ Each {{DOMException}} object has associated fields:
14608
+
14609
+ * its <dfn for="DOMException">name</dfn>, which is [=strings=],
14610
+ * its <dfn for="DOMException">message</dfn>, which is [=strings=],
14603
14611
14604
14612
The
14605
- <dfn constructor for="DOMException" lt="DOMException(message, name)"><code>new DOMException(|message|, |name|)</code></dfn>
14613
+ <dfn constructor for="DOMException" lt="DOMException(message, nameOrOptions)">
14614
+ <code>new DOMException(|message|, |nameOrOptions|)</code>
14615
+ </dfn>
14606
14616
constructor steps are:
14607
14617
14608
- 1. Set [=this=]'s [=DOMException/name=] to |name|.
14609
- 1. Set [=this=]'s [=DOMException/message=] to |message|.
14618
+ 1. Set [=this=]'s [=DOMException/message=] to |message|.
14619
+ 1. If |nameOrOptions| is a string, set [=this=]'s [=DOMException/name=] to
14620
+ |nameOrOptions|.
14621
+ 1. Else,
14622
+ 1. If |nameOrOptions|'name is present, set [=this=]'s [=DOMException/name=]
14623
+ to |nameOrOptions|'s name, else set [=this=]'s [=DOMException/name=]
14624
+ to "Error".
14625
+ 1. Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |nameOrOptions|).
14610
14626
14611
14627
The <dfn attribute for="DOMException"><code>name</code></dfn> getter steps are to return
14612
14628
[=this=]'s [=DOMException/name=].
0 commit comments