Skip to content

Commit 9eb6302

Browse files
committed
Add DOMException cause
1 parent d720ef3 commit 9eb6302

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

index.bs

Lines changed: 13 additions & 4 deletions
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 = "Error";
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 (DOMExceptionOptions or DOMString) options = {});
1456614572
readonly attribute DOMString name;
1456714573
readonly attribute DOMString message;
1456814574
readonly attribute unsigned short code;
@@ -14602,11 +14608,14 @@ 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, options)"><code>new DOMException(|message|, |options|)</code></dfn>
1460614612
constructor steps are:
1460714613

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|).
1461014619

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

0 commit comments

Comments
 (0)