Skip to content

Commit

Permalink
Make DOMException serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
yutakahirano authored and domenic committed Jul 3, 2019
1 parent 115f37b commit f23ef42
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion index.bs
Expand Up @@ -13392,7 +13392,8 @@ fragment:
<pre class="idl">
[
Exposed=(Window,Worker),
Constructor(optional DOMString message = "", optional DOMString name = "Error")
Constructor(optional DOMString message = "", optional DOMString name = "Error"),
Serializable
]
interface DOMException { // but see below note about ECMAScript binding
readonly attribute DOMString name;
Expand Down Expand Up @@ -13449,6 +13450,26 @@ The <dfn attribute for="DOMException"><code>code</code></dfn> attribute's getter
legacy code indicated in the [=error names table=] for this {{DOMException}} object's
[=DOMException/name=], or 0 if no such entry exists in the table.

{{DOMException}} objects are [=serializable objects=].

Their [=serialization steps=], given <var>value</var> and <var>serialized</var>, are:

<ol>
<li>Set <var>serialized</var>.\[[Name]] to <var>value</var>'s [=DOMException/name=].</li>
<li>Set <var>serialized</var>.\[[Message]] to <var>value</var>'s [=DOMException/message=].</li>
<li>User agents should attach a serialized representation of any interesting accompanying data
which are not yet specified, notably the <code>stack</code> property, to
<var>serialized</var>.</li>
</ol>

Their [=deserialization steps=], given <var>value</var> and <var>serialized</var>, are:

<ol>
<li><Set <var>value</var>'s [=DOMException/name=] to <var>serialized</var>.\[[Name]].</li>
<li><Set <var>value</var>'s [=DOMException/message=] to <var>serialized</var>.\[[Message]].</li>
<li>If any other data is attached to <var>serialized</var>, then deserialize and attach it to
<var>value</var>.</li>
</ol>

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

Expand Down

0 comments on commit f23ef42

Please sign in to comment.