Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicates in transferList for structured cloning #3507

Closed
Ms2ger opened this issue Feb 26, 2018 · 0 comments
Closed

Duplicates in transferList for structured cloning #3507

Ms2ger opened this issue Feb 26, 2018 · 0 comments
Labels
interop Implementations are not interoperable with each other topic: serialize and transfer

Comments

@Ms2ger
Copy link
Member

Ms2ger commented Feb 26, 2018

10:44:20 <Ms2ger> annevk, if you pass the same object twice in transferList when structured cloning, where does the spec handle that?
10:47:09 <annevk> Ms2ger: good question, maybe the throwing early on https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializewithtransfer needs to be moved down
10:47:17 <annevk> early on in*
10:48:28 <annevk> Ms2ger: would need to create a test where StructuredSerializeInternal throws something other than a DataCloneError to see if they actually happen later
10:56:22 <annevk> Ms2ger: curiously Safari does not throw on buffer = new ArrayBuffer(10);postMessage(null, "*", [buffer, buffer]);
11:07:09 <annevk> Ms2ger: are you going to file issues here?
11:07:22 <Ms2ger> Yeah, in a minute
11:09:15 <annevk> I can never remember how to write a getter in an object literal
11:10:48 <annevk> So buffer = new MessageChannel().port1;postMessage({ get data() { throw 'hi'; } }, "*", [buffer, buffer]); suggests duplicates are caught earlier on though
11:11:35 <annevk> So basically before we set memory[transferable] we should have "If memory[transferable] exists, throw a ..."
11:18:28 <annevk> At least it's an easy fix...
@annevk annevk added interop Implementations are not interoperable with each other topic: serialize and transfer labels Feb 26, 2018
annevk added a commit that referenced this issue Feb 26, 2018
annevk added a commit that referenced this issue Feb 26, 2018
Duplicates are not allowed in most implementations and throw an error (before any serialization exceptions). This aligns the standard with that behavior.

Tests: web-platform-tests/wpt#9672.

Fixes #3507.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
Duplicates are not allowed in most implementations and throw an error (before any serialization exceptions). This aligns the standard with that behavior.

Tests: web-platform-tests/wpt#9672.

Fixes whatwg#3507.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: serialize and transfer
Development

No branches or pull requests

2 participants