diff --git a/index.bs b/index.bs index 3c38194f..d1fbf3f0 100644 --- a/index.bs +++ b/index.bs @@ -14613,13 +14613,19 @@ The {{DOMException}} type is an [=interface type=] defined by the following IDL fragment:
+dictionary DOMExceptionOptions {
+ any cause;
+ DOMString name = "Error";
+};
+
[Exposed=*,
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;
@@ -14655,12 +14661,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. If |options|["{{DOMExceptionOptions/cause}}"] [=map/exists=], then set [=this=]'s [=DOMException/cause=] to |options|["{{DOMExceptionOptions/cause}}"].
The name getter steps are to return
[=this=]'s [=DOMException/name=].
@@ -14668,6 +14680,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 DOMException names table for [=this=]'s
[=DOMException/name=], or 0 if no such entry exists in the table.
@@ -14679,6 +14694,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 the [=sub-serialization=] of value's [=DOMException/cause=].
- User agents should attach a serialized representation of any interesting accompanying data
which are not yet specified, notably the
stack property, to
serialized.
@@ -14689,6 +14705,7 @@ Their [=deserialization steps=], given value and serialized
- Set value's [=DOMException/name=] to serialized.\[[Name]].
- Set value's [=DOMException/message=] to serialized.\[[Message]].
+ - Set value's [=DOMException/cause=] to the [=sub-deserialization=] of serialized.\[[Cause]].
- If any other data is attached to serialized, then deserialize and attach it to
value.