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 juanarbol committed Mar 5, 2023
1 parent 5adb743 commit 94421b4
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 @@ -627,7 +627,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 @@ -637,7 +637,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 @@ -698,7 +698,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 @@ -982,7 +982,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 94421b4

Please sign in to comment.