Skip to content

Factor out WritableStreamDefaultWriterRelease #513

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

Merged
merged 1 commit into from
Sep 9, 2016

Conversation

domenic
Copy link
Member

@domenic domenic commented Aug 30, 2016

This will help with specifying pipeTo, as seen in #512. This also aligns the spec, tests, and reference implementation on sharing a single error object across both closed and ready promises; previously this was untested and the reference implementation did so but the spec did not.

@domenic domenic force-pushed the factor-out-ws-release branch 2 times, most recently from de47215 to 36b7a28 Compare August 31, 2016 22:26
@domenic
Copy link
Member Author

domenic commented Aug 31, 2016

Rebased and moved the test to WPT format; would appreciate a quick review :)

const writer = ws.getWriter();
writer.releaseLock();

return writer.closed.then(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use the weird promise_rejects() function from testharness.js? Something like

return promise_rejects(t, 'TypeError', writer.closed, 'closed promise rejects')
.then(promise_rejects(t, 'TypeError', writer.ready, 'ready promise rejects');

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but then I would have to write about this much code to test that they're equal (line 96), so I'm not sure it gains much :-/.

@tyoshino
Copy link
Member

tyoshino commented Sep 9, 2016

lgtm. Sorry for delay!!!

@domenic domenic force-pushed the factor-out-ws-release branch from 36b7a28 to cf9f6a9 Compare September 9, 2016 19:10
This will help with specifying pipeTo, as seen in #512. This also aligns the spec, tests, and reference implementation on sharing a single error object across both closed and ready promises; previously this was untested and the reference implementation did so but the spec did not.
@domenic domenic force-pushed the factor-out-ws-release branch from cf9f6a9 to aa59974 Compare September 9, 2016 19:12
@domenic domenic merged commit aa59974 into master Sep 9, 2016
@domenic domenic deleted the factor-out-ws-release branch September 9, 2016 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants