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

First class source sink objects #265

Merged
merged 3 commits into from
Jan 22, 2015
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented Jan 17, 2015

Fixes #256 (/cc @jkrems).

Could use some careful review as the changes were pretty wide-ranging. I am not too worried about the algorithms---the reference implementation and its extensive test suite help with my confidence there---but the editorial changes always leave the potential for pointers, "dead code", etc.

Preview at https://streams.spec.whatwg.org/branch-snapshots/first-class-source-sink-objects/

@@ -1308,52 +1274,47 @@ Instances of <code>WritableStream</code> are created with the internal slots des
<h4 id="ws-constructor">new WritableStream({ start, write, close, abort, strategy } = {})</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the title be also modified, for the symmetry with ReadableStream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch, thank you! This actually has normative consequences, as we no longer do destructuring into functions, but instead preserve the whole object.

@domenic domenic force-pushed the first-class-source-sink-objects branch from 959fc4e to 787d1c6 Compare January 21, 2015 21:18
Part of #256. This also removes the concept of the "default readable stream strategy" in favor of incorporating the defaults into the algorithms directly.
Closes #256. As with the previous commit for readable streams, removes the idea of a default writable stream queuing strategy in favor of just incorporating the fallbacks into the algorithms directly.
The previous commits introduced many new places that we call in to user code, since we no longer validate that we are grabbing functions and then store them, but instead extract and invoke methods every time. This commit adds tests for a variety of pathological inputs, to ensure that the errors they throw are propagated or caught-and-exposed, as appropriate.
@domenic domenic force-pushed the first-class-source-sink-objects branch from 787d1c6 to 7676d81 Compare January 21, 2015 22:13
@domenic domenic merged commit 7676d81 into master Jan 22, 2015
@domenic domenic deleted the first-class-source-sink-objects branch February 9, 2015 20:04
tyoshino added a commit that referenced this pull request Feb 10, 2015
Porting #265 to ReadableByteStream
tyoshino added a commit that referenced this pull request Feb 10, 2015
Porting #265 to ReadableByteStream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Allow object with methods to be passed as (writeable) sink
3 participants