Skip to content

Conversation

@andreubotella
Copy link
Member

@andreubotella andreubotella commented Sep 17, 2021

StructuredDeserialize expects the first argument to be a record containing the [[Type]] slot, as would be returned by StructuredSerialize and StructuredSerializeForStorage. StructuredSerializeWithTransfer returns instead a record with [[Serialized]] and [[TransferDataHolders]] slots, which must be deserialized using the StructuredDeserializeWithTransfer operation.

It seems like this was an oversight in #3414.

cc @surma

(See WHATWG Working Mode: Changes for more details.)


/structured-data.html ( diff )

`StructuredDeserialize` expects the first argument to be a record
containing the [[Type]] slot, as would be returned by
`StructuredSerialize` and `StructuredSerializeForStorage`.
`StructuredSerializeWithTransfer` returns instead a record with
[[Serialized]] and [[TransferDataHolders]] slots, which must be
deserialized using the `StructuredDeserializeWithTransfer` operation.

It seems like this was an oversight in whatwg#3414.
Copy link
Contributor

@surma surma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that you are correct! But gonna wait on one of the HTML folks to weigh in with authority on this one :) Thank you for fixing this!

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, great catch.

@domenic domenic merged commit 75254d9 into whatwg:main Sep 17, 2021
@andreubotella andreubotella deleted the structured-clone-transfer-mismatch branch September 17, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants