Initial structuredClone implementation (#32960)

* Initial structuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Rename PostMessageOptions to StructuredSerializeOptions

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test 2020 layout result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove dublicated StructuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove comment from StructuredSerializeOptions webidl

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-08-08 12:12:45 +02:00 committed by GitHub
parent f989d3776e
commit 08eb4faf4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 74 additions and 862 deletions

View file

@ -1,12 +0,0 @@
[structured-clone-cross-realm-method.html]
[Object instance]
expected: FAIL
[Array instance]
expected: FAIL
[Date instance]
expected: FAIL
[RegExp instance]
expected: FAIL

View file

@ -1,687 +1,21 @@
[structured-clone.any.worker.html]
[primitive undefined]
expected: FAIL
[primitive null]
expected: FAIL
[primitive true]
expected: FAIL
[primitive false]
expected: FAIL
[primitive string, empty string]
expected: FAIL
[primitive string, lone high surrogate]
expected: FAIL
[primitive string, lone low surrogate]
expected: FAIL
[primitive string, NUL]
expected: FAIL
[primitive string, astral character]
expected: FAIL
[primitive number, 0.2]
expected: FAIL
[primitive number, 0]
expected: FAIL
[primitive number, -0]
expected: FAIL
[primitive number, NaN]
expected: FAIL
[primitive number, Infinity]
expected: FAIL
[primitive number, -Infinity]
expected: FAIL
[primitive number, 9007199254740992]
expected: FAIL
[primitive number, -9007199254740992]
expected: FAIL
[primitive number, 9007199254740994]
expected: FAIL
[primitive number, -9007199254740994]
expected: FAIL
[primitive BigInt, 0n]
expected: FAIL
[primitive BigInt, -0n]
expected: FAIL
[primitive BigInt, -9007199254740994000n]
expected: FAIL
[primitive BigInt, -9007199254740994000900719925474099400090071992547409940009007199254740994000n]
expected: FAIL
[Array primitives]
expected: FAIL
[Object primitives]
expected: FAIL
[Boolean true]
expected: FAIL
[Boolean false]
expected: FAIL
[Array Boolean objects]
expected: FAIL
[Object Boolean objects]
expected: FAIL
[String empty string]
expected: FAIL
[String lone high surrogate]
expected: FAIL
[String lone low surrogate]
expected: FAIL
[String NUL]
expected: FAIL
[String astral character]
expected: FAIL
[Array String objects]
expected: FAIL
[Object String objects]
expected: FAIL
[Number 0.2]
expected: FAIL
[Number 0]
expected: FAIL
[Number -0]
expected: FAIL
[Number NaN]
expected: FAIL
[Number Infinity]
expected: FAIL
[Number -Infinity]
expected: FAIL
[Number 9007199254740992]
expected: FAIL
[Number -9007199254740992]
expected: FAIL
[Number 9007199254740994]
expected: FAIL
[Number -9007199254740994]
expected: FAIL
[BigInt -9007199254740994n]
expected: FAIL
[Array Number objects]
expected: FAIL
[Object Number objects]
expected: FAIL
[Date 0]
expected: FAIL
[Date -0]
expected: FAIL
[Date -8.64e15]
expected: FAIL
[Date 8.64e15]
expected: FAIL
[Array Date objects]
expected: FAIL
[Object Date objects]
expected: FAIL
[RegExp flags and lastIndex]
expected: FAIL
[RegExp sticky flag]
expected: FAIL
[RegExp unicode flag]
expected: FAIL
[RegExp empty]
expected: FAIL
[RegExp slash]
expected: FAIL
[RegExp new line]
expected: FAIL
[Array RegExp object, RegExp flags and lastIndex]
expected: FAIL
[Array RegExp object, RegExp sticky flag]
expected: FAIL
[Array RegExp object, RegExp unicode flag]
expected: FAIL
[Array RegExp object, RegExp empty]
expected: FAIL
[Array RegExp object, RegExp slash]
expected: FAIL
[Array RegExp object, RegExp new line]
expected: FAIL
[Object RegExp object, RegExp flags and lastIndex]
expected: FAIL
[Object RegExp object, RegExp sticky flag]
expected: FAIL
[Object RegExp object, RegExp unicode flag]
expected: FAIL
[Object RegExp object, RegExp empty]
expected: FAIL
[Object RegExp object, RegExp slash]
expected: FAIL
[Object RegExp object, RegExp new line]
expected: FAIL
[Blob basic]
expected: FAIL
[Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Blob empty]
expected: FAIL
[Blob NUL]
expected: FAIL
[Array Blob object, Blob basic]
expected: FAIL
[Array Blob object, Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob empty]
expected: FAIL
[Array Blob object, Blob NUL]
expected: FAIL
[Array Blob object, two Blobs]
expected: FAIL
[Object Blob object, Blob basic]
expected: FAIL
[Object Blob object, Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob empty]
expected: FAIL
[Object Blob object, Blob NUL]
expected: FAIL
[File basic]
expected: FAIL
[Array sparse]
expected: FAIL
[Array with non-index property]
expected: FAIL
[Object with index property and length]
expected: FAIL
[Array with circular reference]
expected: FAIL
[Object with circular reference]
expected: FAIL
[Array with identical property values]
expected: FAIL
[Object with identical property values]
expected: FAIL
[Object with property on prototype]
expected: FAIL
[Object with non-enumerable property]
expected: FAIL
[Object with non-writable property]
expected: FAIL
[Object with non-configurable property]
expected: FAIL
[ObjectPrototype must lose its exotic-ness when cloned]
expected: FAIL
[ArrayBuffer]
expected: FAIL
[MessagePort]
expected: FAIL
[Serializing a non-serializable platform object fails]
expected: FAIL
[An object whose interface is deleted from the global must still deserialize]
expected: FAIL
[A subclass instance will deserialize as its closest serializable superclass]
expected: FAIL
[A detached ArrayBuffer cannot be transferred]
expected: FAIL
[A detached platform object cannot be transferred]
expected: FAIL
[Transferring a non-transferable platform object fails]
expected: FAIL
[An object whose interface is deleted from the global object must still be received]
expected: FAIL
[A subclass instance will be received as its closest transferable superclass]
expected: FAIL
[Empty Error object]
expected: FAIL
[Error object]
expected: FAIL
[EvalError object]
expected: FAIL
[RangeError object]
expected: FAIL
[ReferenceError object]
expected: FAIL
[SyntaxError object]
expected: FAIL
[TypeError object]
expected: FAIL
[URIError object]
expected: FAIL
expected: PRECONDITION_FAILED
[Object with a getter that throws]
expected: FAIL
[Resizable ArrayBuffer]
expected: FAIL
[Growable SharedArrayBuffer]
expected: FAIL
[Length-tracking TypedArray]
expected: FAIL
[Length-tracking DataView]
expected: FAIL
[Serializing OOB TypedArray throws]
expected: FAIL
[Serializing OOB DataView throws]
expected: FAIL
[Resizable ArrayBuffer is transferable]
expected: FAIL
[Length-tracking TypedArray is transferable]
expected: FAIL
[Length-tracking DataView is transferable]
expected: FAIL
[Transferring OOB TypedArray throws]
expected: FAIL
[Transferring OOB DataView throws]
expected: FAIL
[structured-clone.any.html]
[primitive undefined]
expected: FAIL
[primitive null]
expected: FAIL
[primitive true]
expected: FAIL
[primitive false]
expected: FAIL
[primitive string, empty string]
expected: FAIL
[primitive string, lone high surrogate]
expected: FAIL
[primitive string, lone low surrogate]
expected: FAIL
[primitive string, NUL]
expected: FAIL
[primitive string, astral character]
expected: FAIL
[primitive number, 0.2]
expected: FAIL
[primitive number, 0]
expected: FAIL
[primitive number, -0]
expected: FAIL
[primitive number, NaN]
expected: FAIL
[primitive number, Infinity]
expected: FAIL
[primitive number, -Infinity]
expected: FAIL
[primitive number, 9007199254740992]
expected: FAIL
[primitive number, -9007199254740992]
expected: FAIL
[primitive number, 9007199254740994]
expected: FAIL
[primitive number, -9007199254740994]
expected: FAIL
[primitive BigInt, 0n]
expected: FAIL
[primitive BigInt, -0n]
expected: FAIL
[primitive BigInt, -9007199254740994000n]
expected: FAIL
[primitive BigInt, -9007199254740994000900719925474099400090071992547409940009007199254740994000n]
expected: FAIL
[Array primitives]
expected: FAIL
[Object primitives]
expected: FAIL
[Boolean true]
expected: FAIL
[Boolean false]
expected: FAIL
[Array Boolean objects]
expected: FAIL
[Object Boolean objects]
expected: FAIL
[String empty string]
expected: FAIL
[String lone high surrogate]
expected: FAIL
[String lone low surrogate]
expected: FAIL
[String NUL]
expected: FAIL
[String astral character]
expected: FAIL
[Array String objects]
expected: FAIL
[Object String objects]
expected: FAIL
[Number 0.2]
expected: FAIL
[Number 0]
expected: FAIL
[Number -0]
expected: FAIL
[Number NaN]
expected: FAIL
[Number Infinity]
expected: FAIL
[Number -Infinity]
expected: FAIL
[Number 9007199254740992]
expected: FAIL
[Number -9007199254740992]
expected: FAIL
[Number 9007199254740994]
expected: FAIL
[Number -9007199254740994]
expected: FAIL
[BigInt -9007199254740994n]
expected: FAIL
[Array Number objects]
expected: FAIL
[Object Number objects]
expected: FAIL
[Date 0]
expected: FAIL
[Date -0]
expected: FAIL
[Date -8.64e15]
expected: FAIL
[Date 8.64e15]
expected: FAIL
[Array Date objects]
expected: FAIL
[Object Date objects]
expected: FAIL
[RegExp flags and lastIndex]
expected: FAIL
[RegExp sticky flag]
expected: FAIL
[RegExp unicode flag]
expected: FAIL
[RegExp empty]
expected: FAIL
[RegExp slash]
expected: FAIL
[RegExp new line]
expected: FAIL
[Array RegExp object, RegExp flags and lastIndex]
expected: FAIL
[Array RegExp object, RegExp sticky flag]
expected: FAIL
[Array RegExp object, RegExp unicode flag]
expected: FAIL
[Array RegExp object, RegExp empty]
expected: FAIL
[Array RegExp object, RegExp slash]
expected: FAIL
[Array RegExp object, RegExp new line]
expected: FAIL
[Object RegExp object, RegExp flags and lastIndex]
expected: FAIL
[Object RegExp object, RegExp sticky flag]
expected: FAIL
[Object RegExp object, RegExp unicode flag]
expected: FAIL
[Object RegExp object, RegExp empty]
expected: FAIL
[Object RegExp object, RegExp slash]
expected: FAIL
[Object RegExp object, RegExp new line]
expected: FAIL
[Blob basic]
expected: FAIL
[Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Blob empty]
expected: FAIL
[Blob NUL]
expected: FAIL
[Array Blob object, Blob basic]
expected: FAIL
[Array Blob object, Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Array Blob object, Blob empty]
expected: FAIL
[Array Blob object, Blob NUL]
expected: FAIL
[Array Blob object, two Blobs]
expected: FAIL
[Object Blob object, Blob basic]
expected: FAIL
[Object Blob object, Blob unpaired high surrogate (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob unpaired low surrogate (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob paired surrogates (invalid utf-8)]
expected: FAIL
[Object Blob object, Blob empty]
expected: FAIL
[Object Blob object, Blob NUL]
expected: FAIL
[File basic]
expected: FAIL
@ -712,39 +46,6 @@
[Object ImageData object, ImageData 1x1 non-transparent non-black]
expected: FAIL
[Array sparse]
expected: FAIL
[Array with non-index property]
expected: FAIL
[Object with index property and length]
expected: FAIL
[Array with circular reference]
expected: FAIL
[Object with circular reference]
expected: FAIL
[Array with identical property values]
expected: FAIL
[Object with identical property values]
expected: FAIL
[Object with property on prototype]
expected: FAIL
[Object with non-enumerable property]
expected: FAIL
[Object with non-writable property]
expected: FAIL
[Object with non-configurable property]
expected: FAIL
[ImageBitmap 1x1 transparent black]
expected: FAIL
@ -763,95 +64,14 @@
[Object ImageBitmap object, ImageBitmap 1x1 transparent non-black]
expected: FAIL
[ObjectPrototype must lose its exotic-ness when cloned]
expected: FAIL
[ArrayBuffer]
expected: FAIL
[MessagePort]
expected: FAIL
[Serializing a non-serializable platform object fails]
expected: FAIL
[An object whose interface is deleted from the global must still deserialize]
expected: FAIL
[A subclass instance will deserialize as its closest serializable superclass]
expected: FAIL
[A detached ArrayBuffer cannot be transferred]
expected: FAIL
[A detached platform object cannot be transferred]
expected: FAIL
[Transferring a non-transferable platform object fails]
expected: FAIL
[An object whose interface is deleted from the global object must still be received]
expected: FAIL
[A subclass instance will be received as its closest transferable superclass]
expected: FAIL
[Empty Error object]
expected: FAIL
[Error object]
expected: FAIL
[EvalError object]
expected: FAIL
[RangeError object]
expected: FAIL
[ReferenceError object]
expected: FAIL
[SyntaxError object]
expected: FAIL
[TypeError object]
expected: FAIL
[URIError object]
expected: FAIL
expected: PRECONDITION_FAILED
[Object with a getter that throws]
expected: FAIL
[Resizable ArrayBuffer]
expected: FAIL
[Growable SharedArrayBuffer]
expected: FAIL
[Length-tracking TypedArray]
expected: FAIL
[Length-tracking DataView]
expected: FAIL
[Serializing OOB TypedArray throws]
expected: FAIL
[Serializing OOB DataView throws]
expected: FAIL
[Resizable ArrayBuffer is transferable]
expected: FAIL
[Length-tracking TypedArray is transferable]
expected: FAIL
[Length-tracking DataView is transferable]
expected: FAIL
[Transferring OOB TypedArray throws]
expected: FAIL
[Transferring OOB DataView throws]
expected: FAIL