- From: Adam Rice <notifications@github.com>
- Date: Fri, 10 Jul 2020 18:37:40 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1053/review/446767044@github.com>
@ricea commented on this pull request. > +<div algorithm="ReadableStream transfer steps"> +{{ReadableStream}} objects are [=transferable objects=]. Their [=transfer steps=], given |value| and +|dataHolder|, are: + + 1. [=Create a new MessagePort object=] whose [=owner=] is the [=incumbent settings object=] and let + |port1| be that object. + 1. [=Create a new MessagePort object=] whose [=owner=] is the [=incumbent settings object=] and let + |port2| be that object. + 1. [=Entangle=] the |port1| and |port2| objects. + 1. If ! [$IsReadableStreamLocked$](|value|) is true, throw a {{TypeError}} exception. + 1. Let |writable| be a [=new=] {{WritableStream}}. + 1. Perform ! [$SetUpCrossRealmTransformWritable$](|writable|, |port1|). + 1. Let |promise| be ! [$ReadableStreamPipeTo$](|value|, |writable|, false, false, false, undefined). + 1. Set |promise|.\[[PromiseIsHandled]] to true. + 1. Let |messagePortDataHolder| be { \[[Type]]: `"MessagePort"` }. + 1. Perform {{MessagePort}}'s transfer steps <!-- TODO(ricea): Link this somehow --> with |port2| Done. I made it slightly higher-level to avoid poking around in the internals of the serialization algorithm. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/1053#discussion_r453139317
Received on Saturday, 11 July 2020 01:37:53 UTC