- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 08 Dec 2016 18:15:35 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/pull/623/c265914911@github.com>
> Can you elaborate? I'm not familiar with IndexedDB. IndexedDB uses structured clone, kind of. But then it writes to disk, instead of recreating the object in another realm. So the current structure of StructuredClone is kind of broken for it. > This PR doesn't make streams cloneable anyway, trying to clone them is still an error as long as ReadableStream lacks a [[Clone]] internal method. They're still only transferable. Good point. Maybe it is even more fine then. > Not necessarily. Why should a cloning stream be errored, when bytes streams don't error the stream when you provide an unacceptable chunk either? You can just have enqueue throw if cloning/serializing to an Agent Record fails. If the underlyingSource doesn't catch the thrown DataCloneError, then the stream obviously gets errored. I said error the *destination* stream, not the original being-cloned stream. > We could attempt a StructuredClone of the error object actually, since it may or may not be uncloneable, and just place a DataCloneError in the slot if the clone attempt throws. Yes, we'd definitely try to clone it at first. I guess "DataCloneError" DOMException is better if that fails. -- 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/623#issuecomment-265914911
Received on Friday, 9 December 2016 02:16:09 UTC