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

Align WritableStream structure with ReadableStream structure #462

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
17c3b10
Align WritableStream structure with ReadableStream structure
tyoshino Dec 8, 2015
cfcb5f4
Some more work
tyoshino May 31, 2016
ae2e3f0
Brush up TransformStream implementation
tyoshino Jun 1, 2016
b8925a8
Updated some WritableStream test cases
tyoshino Jun 2, 2016
36f7aab
Some abort related test fixes
tyoshino Jun 2, 2016
487faf0
More text fix + fix on _writing flag bug
tyoshino Jun 2, 2016
8973296
Clean up
tyoshino Jun 2, 2016
0eda159
More fix on tests/writable-stream.js
tyoshino Jun 2, 2016
5c461ed
More fix
tyoshino Jun 2, 2016
3c26174
More text fix
tyoshino Jun 7, 2016
d7afc2c
Updated pipeTo algorithm
tyoshino Jun 9, 2016
84e8d14
Updating
tyoshino Jun 10, 2016
3aefe10
Fixed some more pipe-to tests
tyoshino Jul 4, 2016
210e594
Finished fixing pipe-to.js and pipe-to-options.js
tyoshino Jul 6, 2016
6c7ef8c
Fixed all pipe tests
tyoshino Jul 7, 2016
5154b7f
Fixed transform-stream.js test
tyoshino Jul 12, 2016
e7c63f2
More fix
tyoshino Jul 12, 2016
71a7bf4
All tests pass
tyoshino Jul 13, 2016
b417f8c
Relaxed lock release criteria and enabled skipped tests
tyoshino Jul 14, 2016
23f089f
Revert rethrow function change
tyoshino Jul 14, 2016
1ab52e7
Remove lines for debugging
tyoshino Jul 14, 2016
b6dad06
Style, typo fixes
tyoshino Jul 14, 2016
9330212
Fix assertion to allow releaseLock on a closing WritableStream
tyoshino Jul 14, 2016
7d44f01
Add more getWriter() tests
tyoshino Jul 14, 2016
00a9661
Use e => t.error(e)
tyoshino Jul 15, 2016
2c08015
Wrap t.error with lambda
tyoshino Jul 15, 2016
0039992
Simplify pipeTo()
tyoshino Jul 26, 2016
fd84ae6
Tweak
tyoshino Jul 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion reference-implementation/lib/readable-stream.js
Expand Up @@ -1558,7 +1558,6 @@ function ReadableByteStreamControllerCallPullIfNeeded(controller) {
const pullPromise = PromiseInvokeOrNoop(controller._underlyingByteSource, 'pull', [controller]);
pullPromise.then(
() => {
assert(false);
controller._pulling = false;

if (controller._pullAgain === true) {
Expand Down
19 changes: 11 additions & 8 deletions reference-implementation/lib/writable-stream.js
Expand Up @@ -7,26 +7,29 @@ const { DequeueValue, EnqueueValueWithSize, GetTotalQueueSize, PeekQueueValue }

class WritableStream {
constructor(underlyingSink = {}, { size, highWaterMark } = {}) {
// Temporary variable. Never used. To be initialized by the controller.
// Temporary value. Never used. To be overwritten by the initializer code of the controller.
this._state = 'writable';
this._storedError = undefined;

this._writer = undefined;
this._storedError = undefined;

this._writeRequests = [];

// Initialize to undefined first because the constructor of the controller checks this
// variable to validate the caller.
this._writableStreamController = undefined;

const type = underlyingSink.type;
if (type === undefined) {
if (highWaterMark === undefined) {
highWaterMark = 1;
}
this._writableStreamController = new WritableStreamDefaultController(this, underlyingSink, size, highWaterMark);
} else {

if (type !== undefined) {
throw new RangeError('Invalid type is specified');
}

if (highWaterMark === undefined) {
highWaterMark = 1;
}

this._writableStreamController = new WritableStreamDefaultController(this, underlyingSink, size, highWaterMark);
}

get locked() {
Expand Down