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}}"].
 
 The name getter steps are to return
 [=this=]'s [=DOMException/name=].
@@ -14614,6 +14627,9 @@ The name getter steps are t
 The message getter steps are to
 return [=this=]'s [=DOMException/message=].
 
+The cause getter steps are to
+return [=this=]'s [=DOMException/cause=].
+
 The code 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,
 
  1. Set serialized.\[[Name]] to value's [=DOMException/name=].
  2. Set serialized.\[[Message]] to value's [=DOMException/message=].
  3. +
  4. Set serialized.\[[Cause]] to value's [=DOMException/cause=].
  5. User agents should attach a serialized representation of any interesting accompanying data which are not yet specified, notably the stack property, to serialized.
  6. @@ -14635,6 +14652,7 @@ Their [=deserialization steps=], given value and serialized
  7. Set value's [=DOMException/name=] to serialized.\[[Name]].
  8. Set value's [=DOMException/message=] to serialized.\[[Message]].
  9. +
  10. Set value's [=DOMException/cause=] to serialized.\[[Cause]].
  11. If any other data is attached to serialized, then deserialize and attach it to value.