From 32e3822b17be39ad2d6dea96f5c5a6b88cd5c47a Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
IDL-defined cloneable objects are cloneable objects defined through IDL that have - the following internal method:
+IDL-defined objects have the following internal method:
[[Clone]] ( targetRealm, memory )
-IDL-defined clonable objects must define the [[Clone]] internal method such that - it either throws or returns a clone of this, created in targetRealm. It is up to - IDL-defined cloneable objects to define what cloning means for them.
+Unless specified otherwise, invoking the [[Clone]] internal method must throw a
+ DataCloneError
exception. (By default, IDL-defined objects are not cloneable
+ objects.)
IDL-defined cloneable objects are cloneable objects defined through IDL whose + [[Clone]] 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 this, created in + targetRealm. It is up to IDL-defined cloneable objects to define what cloning means for + them.
Objects defined in the JavaScript specification are handled by the StructuredClone abstract operation directly.
@@ -7640,11 +7645,15 @@ interface DOMStringMap { +Whereas all IDL-defined objects have a [[Clone]] internal method, not + all have a [[Detached]] internal slot and a [[Transfer]] internal + method.
+IDL-defined transferable objects must define the [[Transfer]] internal method such - that it either throws or returns a clone of this, created in targetRealm, with - this's underlying data shared with the return value, and this's - [[Detached]] internal slot value set to true. It is up to IDL-defined transferable - objects to define what transfering means for them.
+ that it either throws an exception or returns a clone of this, created in + targetRealm, with this's underlying data shared with the return value, and + this's [[Detached]] internal slot value set to true. It is up to IDL-defined + transferable objects to define what transfering means for them.Objects defined in the JavaScript specification are handled by the StructuredCloneWithTransfer abstract operation directly. (Technically, by @@ -7853,17 +7862,26 @@ interface DOMStringMap { +
Otherwise, if input has a [[Clone]] internal method, then let + output be ? input.[[Clone]](targetRealm, + memory).
Otherwise, if IsCallable(input) is true, then throw a
DataCloneError
exception.
Otherwise, if input has an [[ErrorData]] internal slot, then throw a
- DataCloneError
exception.
Otherwise, if input has any internal slot other than [[Prototype]] or
+ [[Extensible]], then throw a DataCloneError
exception.
Otherwise, if input has a [[Clone]] internal method, then let - output be ? input.[[Clone]](targetRealm).
For instance, a [[PromiseState]] or [[WeakMapData]] internal slot.
+ -Otherwise, if input is an exotic object, then throw a
- DataCloneError
exception.
Otherwise, if input is an exotic object, then throw a
+ DataCloneError
exception.
For instance, a proxy object.
+Otherwise: