Skip to content

Commit 94421b4

Browse files
deokjinkimjuanarbol
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 5adb743 commit 94421b4

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
@@ -627,7 +627,7 @@ added: v16.5.0
627627
Returns the amount of data remaining to fill the {ReadableStream}'s
628628
queue.
629629
630-
#### `readableStreamDefaultController.enqueue(chunk)`
630+
#### `readableStreamDefaultController.enqueue([chunk])`
631631
632632
<!-- YAML
633633
added: v16.5.0
@@ -637,7 +637,7 @@ added: v16.5.0
637637
638638
Appends a new chunk of data to the {ReadableStream}'s queue.
639639
640-
#### `readableStreamDefaultController.error(error)`
640+
#### `readableStreamDefaultController.error([error])`
641641
642642
<!-- YAML
643643
added: v16.5.0
@@ -698,7 +698,7 @@ added: v16.5.0
698698
699699
Appends a new chunk of data to the {ReadableStream}'s queue.
700700
701-
#### `readableByteStreamController.error(error)`
701+
#### `readableByteStreamController.error([error])`
702702
703703
<!-- YAML
704704
added: v16.5.0
@@ -982,7 +982,7 @@ changes:
982982
The `WritableStreamDefaultController` manage's the {WritableStream}'s
983983
internal state.
984984
985-
#### `writableStreamDefaultController.error(error)`
985+
#### `writableStreamDefaultController.error([error])`
986986
987987
<!-- YAML
988988
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)