@@ -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 = "Error";
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 (DOMExceptionOptions or DOMString) options = {} );
14566
14572
readonly attribute DOMString name;
14567
14573
readonly attribute DOMString message;
14568
14574
readonly attribute unsigned short code;
@@ -14602,11 +14608,14 @@ Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn
14602
14608
<dfn for="DOMException">message</dfn>, both [=strings=].
14603
14609
14604
14610
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, options )"><code>new DOMException(|message|, |options |)</code></dfn>
14606
14612
constructor steps are:
14607
14613
14608
- 1. Set [=this=]'s [=DOMException/name=] to |name|.
14609
- 1. Set [=this=]'s [=DOMException/message=] to |message|.
14614
+ 1. Set [=this=]'s [=DOMException/message=] to |message|.
14615
+ 1. If |options| is a string, then set [=this=]'s [=DOMException/name=] to |options|.
14616
+ 1. Otherwise,
14617
+ 1. Set [=this=]'s [=DOMException/name=] to |options|["{{DOMExceptionOptions/name}}"].
14618
+ 1. Perform [=?=] <a abstract-op>InstallErrorCause</a>([=this=], |options|).
14610
14619
14611
14620
The <dfn attribute for="DOMException"><code>name</code></dfn> getter steps are to return
14612
14621
[=this=]'s [=DOMException/name=].
0 commit comments