Skip to content

Commit 9e3fa25

Browse files
Editorial: various fixes
* Fix typo in Close/Enqueue checks for readable byte streams * Remove redundant check in TransformStreamDefaultSinkCloseAlgorithm * Fix link IDs for TransformStream abstract ops
1 parent 63b4407 commit 9e3fa25

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

index.bs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5215,7 +5215,7 @@ The following abstract operations support the implementaiton of the
52155215

52165216
<div algorithm>
52175217
<dfn abstract-op lt="TransformStreamDefaultControllerEnqueue"
5218-
id="set-up-transform-stream-default-controller-enqueue"
5218+
id="transform-stream-default-controller-enqueue"
52195219
export>TransformStreamDefaultControllerEnqueue(|controller|, |chunk|)</dfn> is meant to be called
52205220
by other specifications that wish to enqueue [=chunks=] in the [=readable side=], in the same way
52215221
a developer would enqueue chunks using the stream's associated controller object. Specifications
@@ -5241,7 +5241,7 @@ The following abstract operations support the implementaiton of the
52415241
</div>
52425242
<div algorithm>
52435243
<dfn abstract-op lt="TransformStreamDefaultControllerError"
5244-
id="set-up-transform-stream-default-controller-error"
5244+
id="transform-stream-default-controller-error"
52455245
export>TransformStreamDefaultControllerError(|controller|, |e|)</dfn> is meant to be called by
52465246
other specifications that wish to move the transform stream to an errored state, in the same way a
52475247
developer would error the stream using the stream's associated controller object. Specifications
@@ -5254,7 +5254,7 @@ The following abstract operations support the implementaiton of the
52545254

52555255
<div algorithm>
52565256
<dfn abstract-op lt="TransformStreamDefaultControllerPerformTransform"
5257-
id="set-up-transform-stream-default-controller-perform-transform">TransformStreamDefaultControllerPerformTransform(|controller|, |chunk|)</dfn>
5257+
id="transform-stream-default-controller-perform-transform">TransformStreamDefaultControllerPerformTransform(|controller|, |chunk|)</dfn>
52585258
performs the following steps:
52595259

52605260
1. Let |transformPromise| be the result of performing
@@ -5267,7 +5267,7 @@ The following abstract operations support the implementaiton of the
52675267

52685268
<div algorithm>
52695269
<dfn abstract-op lt="TransformStreamDefaultControllerTerminate"
5270-
id="set-up-transform-stream-default-controller-terminate"
5270+
id="transform-stream-default-controller-terminate"
52715271
export>TransformStreamDefaultControllerTerminate(|controller|)</dfn> is meant to be called by
52725272
other specifications that wish to terminate the transform stream, in the same way a
52735273
developer-created stream would be terminated by its associated controller object. Specifications
@@ -5328,9 +5328,7 @@ side=] of [=transform streams=].
53285328
1. Return the result of [=reacting=] to |flushPromise|:
53295329
1. If |flushPromise| was fulfilled, then:
53305330
1. If |readable|.\[[state]] is "`errored`", throw |readable|.\[[storedError]].
5331-
1. Let |readableController| be |readable|.\[[readableStreamController]].
5332-
1. If ! [$ReadableStreamDefaultControllerCanCloseOrEnqueue$](|readableController|) is true,
5333-
perform ! [$ReadableStreamDefaultControllerClose$](|readableController|).
5331+
1. Perform ! [$ReadableStreamDefaultControllerClose$](|readable|.\[[readableStreamController]]).
53345332
1. If |flushPromise| was rejected with reason |r|, then:
53355333
1. Perform ! [$TransformStreamError$](|stream|, |r|).
53365334
1. Throw |readable|.\[[storedError]].

reference-implementation/lib/abstract-ops/readable-streams.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ function ReadableByteStreamControllerClearPendingPullIntos(controller) {
934934
function ReadableByteStreamControllerClose(controller) {
935935
const stream = controller._controlledReadableStream;
936936

937-
if (controller._closeRequest === true || stream._state !== 'readable') {
937+
if (controller._closeRequested === true || stream._state !== 'readable') {
938938
return;
939939
}
940940

@@ -990,7 +990,7 @@ function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescripto
990990
function ReadableByteStreamControllerEnqueue(controller, chunk) {
991991
const stream = controller._controlledReadableStream;
992992

993-
if (controller._closeRequest === true || stream._state !== 'readable') {
993+
if (controller._closeRequested === true || stream._state !== 'readable') {
994994
return;
995995
}
996996

reference-implementation/lib/abstract-ops/transform-streams.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,7 @@ function TransformStreamDefaultSinkCloseAlgorithm(stream) {
244244
if (readable._state === 'errored') {
245245
throw readable._storedError;
246246
}
247-
const readableController = readable._readableStreamController;
248-
if (ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController) === true) {
249-
ReadableStreamDefaultControllerClose(readableController);
250-
}
247+
ReadableStreamDefaultControllerClose(readable._readableStreamController);
251248
}, r => {
252249
TransformStreamError(stream, r);
253250
throw readable._storedError;

0 commit comments

Comments
 (0)