diff --git a/index.bs b/index.bs index 310cc987..a7672e85 100644 --- a/index.bs +++ b/index.bs @@ -14559,13 +14559,20 @@ The {{DOMException}} type is an [=interface type=] defined by the following IDL fragment:
+ +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; + readonly attribute any cause; const unsigned short INDEX_SIZE_ERR = 1; const unsigned short DOMSTRING_SIZE_ERR = 2; @@ -14601,12 +14608,18 @@ requirements beyond the normal ones for [=interface types=]. Each {{DOMException}} object has an associated name and message, both [=strings=]. +Each {{DOMException}} object has an associated cause, which +is a JavaScript value. It is {{undefined}} unless specified otherwise. + The -new DOMException(|message|, |name|)
+new DOMException(|message|, |options|)
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. Set [=this=]'s [=DOMException/cause=] to |options|["{{DOMExceptionOptions/cause}}"]. Thename
getter steps are to return [=this=]'s [=DOMException/name=]. @@ -14614,6 +14627,9 @@ Thename
getter steps are t Themessage
getter steps are to return [=this=]'s [=DOMException/message=]. +Thecause
getter steps are to +return [=this=]'s [=DOMException/cause=]. + Thecode
getter steps are to return the legacy code indicated in the [=error names table=] for [=this=]'s [=DOMException/name=], or 0 if no such entry exists in the table. @@ -14625,6 +14641,7 @@ Their [=serialization steps=], given value and serialized,
- Set serialized.\[[Name]] to value's [=DOMException/name=].
- Set serialized.\[[Message]] to value's [=DOMException/message=].
+- Set serialized.\[[Cause]] to value's [=DOMException/cause=].
- User agents should attach a serialized representation of any interesting accompanying data which are not yet specified, notably the
@@ -14635,6 +14652,7 @@ Their [=deserialization steps=], given value and serializedstack
property, to serialized.- Set value's [=DOMException/name=] to serialized.\[[Name]].
- Set value's [=DOMException/message=] to serialized.\[[Message]].
+- Set value's [=DOMException/cause=] to serialized.\[[Cause]].
- If any other data is attached to serialized, then deserialize and attach it to value.