- From: Adam Rice <notifications@github.com>
- Date: Thu, 09 Jul 2020 16:43:06 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 9 July 2020 23:43:18 UTC
@ricea commented on this pull request. > +Transferable streams are implemented using a special kind of identity transform which has the +[=writable side=] in one realm and the [=readable side=] in another realm. The following abstract +operations are used to implement these "cross-realm transforms". + +<div algorithm> + <dfn abstract-op lt="PackAndPostMessage">PackAndPostMessage(|port|, |type|, |value|)</dfn> performs + the following steps: + + 1. Let |message| be [$OrdinaryObjectCreate$](null). + 1. Perform [$CreateDataProperty$](|message|, `"type"`, |type|). + 1. Perform [$CreateDataProperty$](|message|, `"value"`, |value|). + 1. Let |targetPort| be the port with which |port| is entangled, if any; otherwise let it be null. + 1. Let |options| be «[ `"transfer"` → « » ]». + 1. Run the [=message port post message steps=] providing |targetPort|, |message| and |options|. + + <p class="note">A JavaScript object is used for transfer to avoid having to duplicate the [=message The duplication is not bad in spec-land, but it's a can of worms in implementation land. -- 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_r452547960
Received on Thursday, 9 July 2020 23:43:18 UTC