{"action":"created","comment":{"url":"https://api.github.com/repos/whatwg/streams/pulls/comments/91649896","pull_request_review_id":12160496,"id":91649896,"diff_hunk":"@@ -1447,6 +1478,12 @@ Instances of {{ReadableStreamDefaultController}} are created with the internal s\n     </tr>\n   </thead>\n   <tr>\n+    <td>\\[[targetRealm]]","path":"index.bs","position":88,"original_position":88,"commit_id":"719783692b9e94889f8da664c4e8d237a889d62d","original_commit_id":"719783692b9e94889f8da664c4e8d237a889d62d","user":{"login":"isonmad","id":16495165,"avatar_url":"https://avatars.githubusercontent.com/u/16495165?v=3","gravatar_id":"","url":"https://api.github.com/users/isonmad","html_url":"https://github.com/isonmad","followers_url":"https://api.github.com/users/isonmad/followers","following_url":"https://api.github.com/users/isonmad/following{/other_user}","gists_url":"https://api.github.com/users/isonmad/gists{/gist_id}","starred_url":"https://api.github.com/users/isonmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isonmad/subscriptions","organizations_url":"https://api.github.com/users/isonmad/orgs","repos_url":"https://api.github.com/users/isonmad/repos","events_url":"https://api.github.com/users/isonmad/events{/privacy}","received_events_url":"https://api.github.com/users/isonmad/received_events","type":"User","site_admin":false},"body":"This approach just seemed intuitive to me.\r\n\r\n- For one, I wanted to make throw-on-enqueue possible, so the clone call has to occur when a chunk first enters the controller's queue, not when it leaves it, as would happen in your algorithm.\r\n- The underlyingSource still lives in the original realm, and has a reference to the controller object. (Conceptually, 'controller' is sort of a term for two different things that are conflated, a public API object provided to the underlyingSource and the hidden implementation details of the stream. The API object is stuck in the original realm of the underlyingSource, but the 'implementation details' of the stream are in charge of moving things between realms, and I was conceiving that as synonymous with a single controller, I guess.)\r\n- I thought it would also be nice to have a stream that clones its chunks *without* having to transfer it to a worker and back again, and there's no need for a second readablestream at all in that case.\r\n- It just seems like less code.","created_at":"2016-12-09T02:31:07Z","updated_at":"2016-12-09T02:31:07Z","html_url":"https://github.com/whatwg/streams/pull/623#discussion_r91649896","pull_request_url":"https://api.github.com/repos/whatwg/streams/pulls/623","_links":{"self":{"href":"https://api.github.com/repos/whatwg/streams/pulls/comments/91649896"},"html":{"href":"https://github.com/whatwg/streams/pull/623#discussion_r91649896"},"pull_request":{"href":"https://api.github.com/repos/whatwg/streams/pulls/623"}}},"pull_request":{"url":"https://api.github.com/repos/whatwg/streams/pulls/623","id":96416481,"html_url":"https://github.com/whatwg/streams/pull/623","diff_url":"https://github.com/whatwg/streams/pull/623.diff","patch_url":"https://github.com/whatwg/streams/pull/623.patch","issue_url":"https://api.github.com/repos/whatwg/streams/issues/623","number":623,"state":"open","locked":false,"title":"Specify ReadableStream.[[Transfer]]","user":{"login":"isonmad","id":16495165,"avatar_url":"https://avatars.githubusercontent.com/u/16495165?v=3","gravatar_id":"","url":"https://api.github.com/users/isonmad","html_url":"https://github.com/isonmad","followers_url":"https://api.github.com/users/isonmad/followers","following_url":"https://api.github.com/users/isonmad/following{/other_user}","gists_url":"https://api.github.com/users/isonmad/gists{/gist_id}","starred_url":"https://api.github.com/users/isonmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isonmad/subscriptions","organizations_url":"https://api.github.com/users/isonmad/orgs","repos_url":"https://api.github.com/users/isonmad/repos","events_url":"https://api.github.com/users/isonmad/events{/privacy}","received_events_url":"https://api.github.com/users/isonmad/received_events","type":"User","site_admin":false},"body":"See also #276.\r\n\r\nAs @domenic mentioned in https://github.com/whatwg/streams/issues/244#issuecomment-257041201, this effort seems more or less blocked on https://github.com/whatwg/html/issues/935, but this at least gives a general idea of the parts it would need to touch.\r\n\r\nIn particular, there's an apparent problem with transferring errored streams (namely `[[storedError]]`), as well as the open question of what even ends up in [[storedError]] if the underlyingSource throws or calls `controller.error()` it from the original realm with something uncloneable.\r\n\r\nStructuredClone doesn't seem to be actually possible to truly polyfill as it iterates over objects in a different order than for-in does, and there doesn't seem to be an obvious way to replicate it; is there any reason StructuredClone isn't/ shouldn't be exposed on its own by the JS engine, for admittedly really niche use cases like this?","created_at":"2016-12-04T00:39:15Z","updated_at":"2016-12-09T02:31:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6539feaaf133f1ff8b40e833526547b365cc8cf9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/whatwg/streams/pulls/623/commits","review_comments_url":"https://api.github.com/repos/whatwg/streams/pulls/623/comments","review_comment_url":"https://api.github.com/repos/whatwg/streams/pulls/comments{/number}","comments_url":"https://api.github.com/repos/whatwg/streams/issues/623/comments","statuses_url":"https://api.github.com/repos/whatwg/streams/statuses/719783692b9e94889f8da664c4e8d237a889d62d","head":{"label":"isonmad:transfer1","ref":"transfer1","sha":"719783692b9e94889f8da664c4e8d237a889d62d","user":{"login":"isonmad","id":16495165,"avatar_url":"https://avatars.githubusercontent.com/u/16495165?v=3","gravatar_id":"","url":"https://api.github.com/users/isonmad","html_url":"https://github.com/isonmad","followers_url":"https://api.github.com/users/isonmad/followers","following_url":"https://api.github.com/users/isonmad/following{/other_user}","gists_url":"https://api.github.com/users/isonmad/gists{/gist_id}","starred_url":"https://api.github.com/users/isonmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isonmad/subscriptions","organizations_url":"https://api.github.com/users/isonmad/orgs","repos_url":"https://api.github.com/users/isonmad/repos","events_url":"https://api.github.com/users/isonmad/events{/privacy}","received_events_url":"https://api.github.com/users/isonmad/received_events","type":"User","site_admin":false},"repo":{"id":68418600,"name":"streams","full_name":"isonmad/streams","owner":{"login":"isonmad","id":16495165,"avatar_url":"https://avatars.githubusercontent.com/u/16495165?v=3","gravatar_id":"","url":"https://api.github.com/users/isonmad","html_url":"https://github.com/isonmad","followers_url":"https://api.github.com/users/isonmad/followers","following_url":"https://api.github.com/users/isonmad/following{/other_user}","gists_url":"https://api.github.com/users/isonmad/gists{/gist_id}","starred_url":"https://api.github.com/users/isonmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isonmad/subscriptions","organizations_url":"https://api.github.com/users/isonmad/orgs","repos_url":"https://api.github.com/users/isonmad/repos","events_url":"https://api.github.com/users/isonmad/events{/privacy}","received_events_url":"https://api.github.com/users/isonmad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isonmad/streams","description":"Streams Standard","fork":true,"url":"https://api.github.com/repos/isonmad/streams","forks_url":"https://api.github.com/repos/isonmad/streams/forks","keys_url":"https://api.github.com/repos/isonmad/streams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isonmad/streams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isonmad/streams/teams","hooks_url":"https://api.github.com/repos/isonmad/streams/hooks","issue_events_url":"https://api.github.com/repos/isonmad/streams/issues/events{/number}","events_url":"https://api.github.com/repos/isonmad/streams/events","assignees_url":"https://api.github.com/repos/isonmad/streams/assignees{/user}","branches_url":"https://api.github.com/repos/isonmad/streams/branches{/branch}","tags_url":"https://api.github.com/repos/isonmad/streams/tags","blobs_url":"https://api.github.com/repos/isonmad/streams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isonmad/streams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isonmad/streams/git/refs{/sha}","trees_url":"https://api.github.com/repos/isonmad/streams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isonmad/streams/statuses/{sha}","languages_url":"https://api.github.com/repos/isonmad/streams/languages","stargazers_url":"https://api.github.com/repos/isonmad/streams/stargazers","contributors_url":"https://api.github.com/repos/isonmad/streams/contributors","subscribers_url":"https://api.github.com/repos/isonmad/streams/subscribers","subscription_url":"https://api.github.com/repos/isonmad/streams/subscription","commits_url":"https://api.github.com/repos/isonmad/streams/commits{/sha}","git_commits_url":"https://api.github.com/repos/isonmad/streams/git/commits{/sha}","comments_url":"https://api.github.com/repos/isonmad/streams/comments{/number}","issue_comment_url":"https://api.github.com/repos/isonmad/streams/issues/comments{/number}","contents_url":"https://api.github.com/repos/isonmad/streams/contents/{+path}","compare_url":"https://api.github.com/repos/isonmad/streams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isonmad/streams/merges","archive_url":"https://api.github.com/repos/isonmad/streams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isonmad/streams/downloads","issues_url":"https://api.github.com/repos/isonmad/streams/issues{/number}","pulls_url":"https://api.github.com/repos/isonmad/streams/pulls{/number}","milestones_url":"https://api.github.com/repos/isonmad/streams/milestones{/number}","notifications_url":"https://api.github.com/repos/isonmad/streams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isonmad/streams/labels{/name}","releases_url":"https://api.github.com/repos/isonmad/streams/releases{/id}","deployments_url":"https://api.github.com/repos/isonmad/streams/deployments","created_at":"2016-09-16T22:28:58Z","updated_at":"2016-09-16T22:29:00Z","pushed_at":"2016-12-04T01:36:39Z","git_url":"git://github.com/isonmad/streams.git","ssh_url":"git@github.com:isonmad/streams.git","clone_url":"https://github.com/isonmad/streams.git","svn_url":"https://github.com/isonmad/streams","homepage":"https://streams.spec.whatwg.org/","size":2191,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"whatwg:master","ref":"master","sha":"872188a984722861020ae773a5ee558892797c33","user":{"login":"whatwg","id":2226336,"avatar_url":"https://avatars.githubusercontent.com/u/2226336?v=3","gravatar_id":"","url":"https://api.github.com/users/whatwg","html_url":"https://github.com/whatwg","followers_url":"https://api.github.com/users/whatwg/followers","following_url":"https://api.github.com/users/whatwg/following{/other_user}","gists_url":"https://api.github.com/users/whatwg/gists{/gist_id}","starred_url":"https://api.github.com/users/whatwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatwg/subscriptions","organizations_url":"https://api.github.com/users/whatwg/orgs","repos_url":"https://api.github.com/users/whatwg/repos","events_url":"https://api.github.com/users/whatwg/events{/privacy}","received_events_url":"https://api.github.com/users/whatwg/received_events","type":"Organization","site_admin":false},"repo":{"id":13962843,"name":"streams","full_name":"whatwg/streams","owner":{"login":"whatwg","id":2226336,"avatar_url":"https://avatars.githubusercontent.com/u/2226336?v=3","gravatar_id":"","url":"https://api.github.com/users/whatwg","html_url":"https://github.com/whatwg","followers_url":"https://api.github.com/users/whatwg/followers","following_url":"https://api.github.com/users/whatwg/following{/other_user}","gists_url":"https://api.github.com/users/whatwg/gists{/gist_id}","starred_url":"https://api.github.com/users/whatwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatwg/subscriptions","organizations_url":"https://api.github.com/users/whatwg/orgs","repos_url":"https://api.github.com/users/whatwg/repos","events_url":"https://api.github.com/users/whatwg/events{/privacy}","received_events_url":"https://api.github.com/users/whatwg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/whatwg/streams","description":"Streams Standard","fork":false,"url":"https://api.github.com/repos/whatwg/streams","forks_url":"https://api.github.com/repos/whatwg/streams/forks","keys_url":"https://api.github.com/repos/whatwg/streams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whatwg/streams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whatwg/streams/teams","hooks_url":"https://api.github.com/repos/whatwg/streams/hooks","issue_events_url":"https://api.github.com/repos/whatwg/streams/issues/events{/number}","events_url":"https://api.github.com/repos/whatwg/streams/events","assignees_url":"https://api.github.com/repos/whatwg/streams/assignees{/user}","branches_url":"https://api.github.com/repos/whatwg/streams/branches{/branch}","tags_url":"https://api.github.com/repos/whatwg/streams/tags","blobs_url":"https://api.github.com/repos/whatwg/streams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whatwg/streams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whatwg/streams/git/refs{/sha}","trees_url":"https://api.github.com/repos/whatwg/streams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whatwg/streams/statuses/{sha}","languages_url":"https://api.github.com/repos/whatwg/streams/languages","stargazers_url":"https://api.github.com/repos/whatwg/streams/stargazers","contributors_url":"https://api.github.com/repos/whatwg/streams/contributors","subscribers_url":"https://api.github.com/repos/whatwg/streams/subscribers","subscription_url":"https://api.github.com/repos/whatwg/streams/subscription","commits_url":"https://api.github.com/repos/whatwg/streams/commits{/sha}","git_commits_url":"https://api.github.com/repos/whatwg/streams/git/commits{/sha}","comments_url":"https://api.github.com/repos/whatwg/streams/comments{/number}","issue_comment_url":"https://api.github.com/repos/whatwg/streams/issues/comments{/number}","contents_url":"https://api.github.com/repos/whatwg/streams/contents/{+path}","compare_url":"https://api.github.com/repos/whatwg/streams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whatwg/streams/merges","archive_url":"https://api.github.com/repos/whatwg/streams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whatwg/streams/downloads","issues_url":"https://api.github.com/repos/whatwg/streams/issues{/number}","pulls_url":"https://api.github.com/repos/whatwg/streams/pulls{/number}","milestones_url":"https://api.github.com/repos/whatwg/streams/milestones{/number}","notifications_url":"https://api.github.com/repos/whatwg/streams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whatwg/streams/labels{/name}","releases_url":"https://api.github.com/repos/whatwg/streams/releases{/id}","deployments_url":"https://api.github.com/repos/whatwg/streams/deployments","created_at":"2013-10-29T17:16:58Z","updated_at":"2016-12-06T03:49:29Z","pushed_at":"2016-12-08T02:18:38Z","git_url":"git://github.com/whatwg/streams.git","ssh_url":"git@github.com:whatwg/streams.git","clone_url":"https://github.com/whatwg/streams.git","svn_url":"https://github.com/whatwg/streams","homepage":"https://streams.spec.whatwg.org/","size":3196,"stargazers_count":619,"watchers_count":619,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":58,"mirror_url":null,"open_issues_count":56,"forks":58,"open_issues":56,"watchers":619,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/whatwg/streams/pulls/623"},"html":{"href":"https://github.com/whatwg/streams/pull/623"},"issue":{"href":"https://api.github.com/repos/whatwg/streams/issues/623"},"comments":{"href":"https://api.github.com/repos/whatwg/streams/issues/623/comments"},"review_comments":{"href":"https://api.github.com/repos/whatwg/streams/pulls/623/comments"},"review_comment":{"href":"https://api.github.com/repos/whatwg/streams/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/whatwg/streams/pulls/623/commits"},"statuses":{"href":"https://api.github.com/repos/whatwg/streams/statuses/719783692b9e94889f8da664c4e8d237a889d62d"}}}}
{"actor":{"display_login":"isonmad"}}