Skip to content

Commit

Permalink
doc: mark some parameters as optional in webstreams
Browse files Browse the repository at this point in the history
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 <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
deokjinkim authored and ruyadorno committed Jan 31, 2023
1 parent 7a9af38 commit f39fb8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions doc/api/webstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ added: v16.5.0
Returns the amount of data remaining to fill the {ReadableStream}'s
queue.
#### `readableStreamDefaultController.enqueue(chunk)`
#### `readableStreamDefaultController.enqueue([chunk])`
<!-- YAML
added: v16.5.0
Expand All @@ -639,7 +639,7 @@ added: v16.5.0
Appends a new chunk of data to the {ReadableStream}'s queue.
#### `readableStreamDefaultController.error(error)`
#### `readableStreamDefaultController.error([error])`
<!-- YAML
added: v16.5.0
Expand Down Expand Up @@ -700,7 +700,7 @@ added: v16.5.0
Appends a new chunk of data to the {ReadableStream}'s queue.
#### `readableByteStreamController.error(error)`
#### `readableByteStreamController.error([error])`
<!-- YAML
added: v16.5.0
Expand Down Expand Up @@ -984,7 +984,7 @@ changes:
The `WritableStreamDefaultController` manage's the {WritableStream}'s
internal state.
#### `writableStreamDefaultController.error(error)`
#### `writableStreamDefaultController.error([error])`
<!-- YAML
added: v16.5.0
Expand Down
10 changes: 5 additions & 5 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ class ReadableStreamDefaultReader {
}

/**
* @param {any} reason
* @param {any} [reason]
* @returns {Promise<void>}
*/
cancel(reason = undefined) {
Expand Down Expand Up @@ -977,7 +977,7 @@ class ReadableStreamBYOBReader {
}

/**
* @param {any} reason
* @param {any} [reason]
* @returns {Promise<void>}
*/
cancel(reason = undefined) {
Expand Down Expand Up @@ -1029,7 +1029,7 @@ class ReadableStreamDefaultController {
}

/**
* @param {any} chunk
* @param {any} [chunk]
*/
enqueue(chunk = undefined) {
if (!readableStreamDefaultControllerCanCloseOrEnqueue(this))
Expand All @@ -1038,7 +1038,7 @@ class ReadableStreamDefaultController {
}

/**
* @param {any} error
* @param {any} [error]
*/
error(error = undefined) {
readableStreamDefaultControllerError(this, error);
Expand Down Expand Up @@ -1152,7 +1152,7 @@ class ReadableByteStreamController {
}

/**
* @param {any} error
* @param {any} [error]
*/
error(error = undefined) {
if (!isReadableByteStreamController(this))
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class WritableStreamDefaultWriter {
}

/**
* @param {any} reason
* @param {any} [reason]
* @returns {Promise<void>}
*/
abort(reason = undefined) {
Expand Down Expand Up @@ -545,7 +545,7 @@ class WritableStreamDefaultController {
}

/**
* @param {any} error
* @param {any} [error]
*/
error(error = undefined) {
if (!isWritableStreamDefaultController(this))
Expand Down

0 comments on commit f39fb8c

Please sign in to comment.