Skip to content

Commit

Permalink
Use platform object rather than IDL-defined object
Browse files Browse the repository at this point in the history
Platform object is an actual established term and not something I made
up on the spot.
  • Loading branch information
annevk authored and domenic committed Mar 4, 2016
1 parent 3fb6447 commit a38e8c3
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -7607,21 +7607,20 @@ interface <dfn>DOMStringMap</dfn> {
<span>cloneable objects</span> and not all aspects of objects that are <span>cloneable
objects</span> are necessarily preserved when cloned.</p>

<p>IDL-defined objects have the following internal method:</p>
<p><span data-x="platform object">Platform objects</span> have the following internal method:</p>

<p>[[<dfn>Clone</dfn>]] ( <var>targetRealm</var>, <var>memory</var> )</p>
<!-- For /deepClone/ support /memory/ would need to be changed as per StructuredClone or we would
need to add a [[DeepClone]] abstract operation. -->

<p>Unless specified otherwise, invoking the [[<span>Clone</span>]] internal method must throw a
<code>DataCloneError</code> exception. (By default, IDL-defined objects are not <span>cloneable
objects</span>.)</p>
<code>DataCloneError</code> exception. (By default, <span data-x="platform object">platform
objects</span> are not <span>cloneable objects</span>.)</p>

<p>IDL-defined cloneable objects are <span>cloneable objects</span> defined through IDL whose
[[<span>Clone</span>]] internal method is specified to run a series of steps. The result of
running those steps must be a thrown exception or a clone of <b>this</b>, created in
<var>targetRealm</var>. It is up to IDL-defined cloneable objects to define what cloning means for
them.</p>
<p><span data-x="platform object">Platform objects</span> that are <span>cloneable objects</span>
have a [[<span>Clone</span>]] internal method which is specified to run a series of steps. The
result of running those steps must be a thrown exception or a clone of <b>this</b>, created in
<var>targetRealm</var>. It is up such objects to define what cloning means for them.</p>

<p>Objects defined in the JavaScript specification are handled by the <span>StructuredClone</span>
abstract operation directly.</p>
Expand All @@ -7638,22 +7637,23 @@ interface <dfn>DOMStringMap</dfn> {
<p class="note">Transferring is an irreversible and non-idempotent operation. Once an object has
been transferred, it cannot be transferred, or indeed used, again.</p>

<p>IDL-defined transferable objects are <span>transferable objects</span> defined through IDL that
have a [[<dfn>Detached</dfn>]] internal slot and the following internal method:</p>
<p><span data-x="platform object">Platform objects</span> that are <span>transferable
objects</span> have a [[<dfn>Detached</dfn>]] internal slot and the following internal method:</p>

<p>[[<dfn>Transfer</dfn>]] ( <var>targetRealm</var> )</p>
<!-- If we ever add /memory/ support here we need to update the language around replacing
references -->

<p class="note">Whereas all IDL-defined objects have a [[<span>Clone</span>]] internal method, not
all have a [[<span>Detached</span>]] internal slot and a [[<span>Transfer</span>]] internal
method.</p>
<p class="note">Whereas all <span data-x="platform object">platform objects</span> have a
[[<span>Clone</span>]] internal method, not all have a [[<span>Detached</span>]] internal slot and
a [[<span>Transfer</span>]] internal method.</p>

<p>IDL-defined transferable objects must define the [[<span>Transfer</span>]] internal method such
that it either throws an exception or returns a clone of <b>this</b>, created in
<var>targetRealm</var>, with <b>this</b>'s underlying data shared with the return value, and
<b>this</b>'s [[<span>Detached</span>]] internal slot value set to true. It is up to IDL-defined
transferable objects to define what transfering means for them.</p>
<p><span data-x="platform object">Platform objects</span> that are <span>transferable
objects</span> must define the [[<span>Transfer</span>]] internal method such that it either
throws an exception or returns a clone of <b>this</b>, created in <var>targetRealm</var>, with
<b>this</b>'s underlying data shared with the return value, and <b>this</b>'s
[[<span>Detached</span>]] internal slot value set to true. It is up to such objects to define what
transfering means for them.</p>

<p>Objects defined in the JavaScript specification are handled by the
<span>StructuredCloneWithTransfer</span> abstract operation directly. (Technically, by
Expand Down

0 comments on commit a38e8c3

Please sign in to comment.