Skip to content

Editorial: rename internal slots for brevity #1061

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 8 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 153 additions & 172 deletions index.bs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports.implementation = class ReadableByteStreamControllerImpl {
throw new TypeError('The stream has already been closed; do not close it again!');
}

const state = this._controlledReadableStream._state;
const state = this._stream._state;
if (state !== 'readable') {
throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);
}
Expand All @@ -53,7 +53,7 @@ exports.implementation = class ReadableByteStreamControllerImpl {
throw new TypeError('stream is closed or draining');
}

const state = this._controlledReadableStream._state;
const state = this._stream._state;
if (state !== 'readable') {
throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be enqueued to`);
}
Expand All @@ -79,7 +79,7 @@ exports.implementation = class ReadableByteStreamControllerImpl {
}

[PullSteps](readRequest) {
const stream = this._controlledReadableStream;
const stream = this._stream;
assert(aos.ReadableStreamHasDefaultReader(stream) === true);

if (this._queueTotalSize > 0) {
Expand Down
4 changes: 2 additions & 2 deletions reference-implementation/lib/ReadableStream-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ exports.implementation = class ReadableStreamImpl {

[idlUtils.asyncIteratorNext](iterator) {
const reader = iterator._reader;
if (reader._ownerReadableStream === undefined) {
if (reader._stream === undefined) {
return promiseRejectedWith(
new TypeError('Cannot get the next iteration result once the reader has been released')
);
Expand All @@ -143,7 +143,7 @@ exports.implementation = class ReadableStreamImpl {

[idlUtils.asyncIteratorReturn](iterator, arg) {
const reader = iterator._reader;
if (reader._ownerReadableStream === undefined) {
if (reader._stream === undefined) {
return promiseResolvedWith(undefined);
}

Expand Down
6 changes: 3 additions & 3 deletions reference-implementation/lib/ReadableStreamBYOBReader-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports.implementation = class ReadableStreamBYOBReaderImpl {
}

cancel(reason) {
if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(readerLockException('cancel'));
}

Expand All @@ -28,7 +28,7 @@ exports.implementation = class ReadableStreamBYOBReaderImpl {
return promiseRejectedWith(new TypeError('view\'s buffer must have non-zero byteLength'));
}

if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(readerLockException('read'));
}

Expand All @@ -43,7 +43,7 @@ exports.implementation = class ReadableStreamBYOBReaderImpl {
}

releaseLock() {
if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports.implementation = class ReadableStreamDefaultControllerImpl {
}

[PullSteps](readRequest) {
const stream = this._controlledReadableStream;
const stream = this._stream;

if (this._queue.length > 0) {
const chunk = DequeueValue(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ exports.implementation = class ReadableStreamDefaultReaderImpl {
}

cancel(reason) {
if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(readerLockException('cancel'));
}

return aos.ReadableStreamReaderGenericCancel(this, reason);
}

read() {
if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(readerLockException('read from'));
}

Expand All @@ -37,7 +37,7 @@ exports.implementation = class ReadableStreamDefaultReaderImpl {
}

releaseLock() {
if (this._ownerReadableStream === undefined) {
if (this._stream === undefined) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion reference-implementation/lib/TransformStream-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.implementation = class TransformStreamImpl {
aos.SetUpTransformStreamDefaultControllerFromTransformer(this, transformer, transformerDict);

if ('start' in transformerDict) {
resolvePromise(startPromise, transformerDict.start.call(transformer, this._transformStreamController));
resolvePromise(startPromise, transformerDict.start.call(transformer, this._controller));
} else {
resolvePromise(startPromise, undefined);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const rsAOs = require('./abstract-ops/readable-streams.js');

exports.implementation = class TransformStreamDefaultController {
get desiredSize() {
const readableController = this._controlledTransformStream._readable._readableStreamController;
const readableController = this._stream._readable._controller;
return rsAOs.ReadableStreamDefaultControllerGetDesiredSize(readableController);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { ResetQueue } = require('./abstract-ops/queue-with-sizes.js');

exports.implementation = class WritableStreamDefaultControllerImpl {
error(e) {
const state = this._controlledWritableStream._state;
const state = this._stream._state;

if (state !== 'writable') {
// The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so
Expand Down
10 changes: 5 additions & 5 deletions reference-implementation/lib/WritableStreamDefaultWriter-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.implementation = class WritableStreamDefaultWriterImpl {
}

get desiredSize() {
if (this._ownerWritableStream === undefined) {
if (this._stream === undefined) {
throw defaultWriterLockException('desiredSize');
}

Expand All @@ -26,15 +26,15 @@ exports.implementation = class WritableStreamDefaultWriterImpl {
}

abort(reason) {
if (this._ownerWritableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(defaultWriterLockException('abort'));
}

return aos.WritableStreamDefaultWriterAbort(this, reason);
}

close() {
const stream = this._ownerWritableStream;
const stream = this._stream;

if (stream === undefined) {
return promiseRejectedWith(defaultWriterLockException('close'));
Expand All @@ -48,7 +48,7 @@ exports.implementation = class WritableStreamDefaultWriterImpl {
}

releaseLock() {
const stream = this._ownerWritableStream;
const stream = this._stream;

if (stream === undefined) {
return;
Expand All @@ -60,7 +60,7 @@ exports.implementation = class WritableStreamDefaultWriterImpl {
}

write(chunk) {
if (this._ownerWritableStream === undefined) {
if (this._stream === undefined) {
return promiseRejectedWith(defaultWriterLockException('write to'));
}

Expand Down
Loading