Skip to content

Commit f39fb8c

Browse files
deokjinkimruyadorno
authored andcommitted
doc: mark some parameters as optional in webstreams
Some parameters are described as optional in spec, so update mismatched parameter. Refs: https://streams.spec.whatwg.org/ PR-URL: #46269 Refs: https://streams.spec.whatwg.org/ Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 7a9af38 commit f39fb8c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

doc/api/webstreams.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ added: v16.5.0
629629
Returns the amount of data remaining to fill the {ReadableStream}'s
630630
queue.
631631
632-
#### `readableStreamDefaultController.enqueue(chunk)`
632+
#### `readableStreamDefaultController.enqueue([chunk])`
633633
634634
<!-- YAML
635635
added: v16.5.0
@@ -639,7 +639,7 @@ added: v16.5.0
639639
640640
Appends a new chunk of data to the {ReadableStream}'s queue.
641641
642-
#### `readableStreamDefaultController.error(error)`
642+
#### `readableStreamDefaultController.error([error])`
643643
644644
<!-- YAML
645645
added: v16.5.0
@@ -700,7 +700,7 @@ added: v16.5.0
700700
701701
Appends a new chunk of data to the {ReadableStream}'s queue.
702702
703-
#### `readableByteStreamController.error(error)`
703+
#### `readableByteStreamController.error([error])`
704704
705705
<!-- YAML
706706
added: v16.5.0
@@ -984,7 +984,7 @@ changes:
984984
The `WritableStreamDefaultController` manage's the {WritableStream}'s
985985
internal state.
986986
987-
#### `writableStreamDefaultController.error(error)`
987+
#### `writableStreamDefaultController.error([error])`
988988
989989
<!-- YAML
990990
added: v16.5.0

lib/internal/webstreams/readablestream.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ class ReadableStreamDefaultReader {
861861
}
862862

863863
/**
864-
* @param {any} reason
864+
* @param {any} [reason]
865865
* @returns {Promise<void>}
866866
*/
867867
cancel(reason = undefined) {
@@ -977,7 +977,7 @@ class ReadableStreamBYOBReader {
977977
}
978978

979979
/**
980-
* @param {any} reason
980+
* @param {any} [reason]
981981
* @returns {Promise<void>}
982982
*/
983983
cancel(reason = undefined) {
@@ -1029,7 +1029,7 @@ class ReadableStreamDefaultController {
10291029
}
10301030

10311031
/**
1032-
* @param {any} chunk
1032+
* @param {any} [chunk]
10331033
*/
10341034
enqueue(chunk = undefined) {
10351035
if (!readableStreamDefaultControllerCanCloseOrEnqueue(this))
@@ -1038,7 +1038,7 @@ class ReadableStreamDefaultController {
10381038
}
10391039

10401040
/**
1041-
* @param {any} error
1041+
* @param {any} [error]
10421042
*/
10431043
error(error = undefined) {
10441044
readableStreamDefaultControllerError(this, error);
@@ -1152,7 +1152,7 @@ class ReadableByteStreamController {
11521152
}
11531153

11541154
/**
1155-
* @param {any} error
1155+
* @param {any} [error]
11561156
*/
11571157
error(error = undefined) {
11581158
if (!isReadableByteStreamController(this))

lib/internal/webstreams/writablestream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ class WritableStreamDefaultWriter {
435435
}
436436

437437
/**
438-
* @param {any} reason
438+
* @param {any} [reason]
439439
* @returns {Promise<void>}
440440
*/
441441
abort(reason = undefined) {
@@ -545,7 +545,7 @@ class WritableStreamDefaultController {
545545
}
546546

547547
/**
548-
* @param {any} error
548+
* @param {any} [error]
549549
*/
550550
error(error = undefined) {
551551
if (!isWritableStreamDefaultController(this))

0 commit comments

Comments
 (0)