Skip to content

Commit f23ef42

Browse files
yutakahiranodomenic
authored andcommitted
Make DOMException serializable
Fixes #729. See also whatwg/html#4268. Tests: * web-platform-tests/wpt#17095 * web-platform-tests/wpt#17159
1 parent 115f37b commit f23ef42

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

index.bs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13392,7 +13392,8 @@ fragment:
1339213392
<pre class="idl">
1339313393
[
1339413394
Exposed=(Window,Worker),
13395-
Constructor(optional DOMString message = "", optional DOMString name = "Error")
13395+
Constructor(optional DOMString message = "", optional DOMString name = "Error"),
13396+
Serializable
1339613397
]
1339713398
interface DOMException { // but see below note about ECMAScript binding
1339813399
readonly attribute DOMString name;
@@ -13449,6 +13450,26 @@ The <dfn attribute for="DOMException"><code>code</code></dfn> attribute's getter
1344913450
legacy code indicated in the [=error names table=] for this {{DOMException}} object's
1345013451
[=DOMException/name=], or 0 if no such entry exists in the table.
1345113452

13453+
{{DOMException}} objects are [=serializable objects=].
13454+
13455+
Their [=serialization steps=], given <var>value</var> and <var>serialized</var>, are:
13456+
13457+
<ol>
13458+
<li>Set <var>serialized</var>.\[[Name]] to <var>value</var>'s [=DOMException/name=].</li>
13459+
<li>Set <var>serialized</var>.\[[Message]] to <var>value</var>'s [=DOMException/message=].</li>
13460+
<li>User agents should attach a serialized representation of any interesting accompanying data
13461+
which are not yet specified, notably the <code>stack</code> property, to
13462+
<var>serialized</var>.</li>
13463+
</ol>
13464+
13465+
Their [=deserialization steps=], given <var>value</var> and <var>serialized</var>, are:
13466+
13467+
<ol>
13468+
<li><Set <var>value</var>'s [=DOMException/name=] to <var>serialized</var>.\[[Name]].</li>
13469+
<li><Set <var>value</var>'s [=DOMException/message=] to <var>serialized</var>.\[[Message]].</li>
13470+
<li>If any other data is attached to <var>serialized</var>, then deserialize and attach it to
13471+
<var>value</var>.</li>
13472+
</ol>
1345213473

1345313474
<h3 id="DOMTimeStamp" typedef oldids="common-DOMTimeStamp">DOMTimeStamp</h3>
1345413475

0 commit comments

Comments
 (0)