Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: make some parameters optional in webstreams #46269

Merged
merged 1 commit into from
Jan 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/api/webstreams.md
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
@@ -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
10 changes: 5 additions & 5 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
@@ -861,7 +861,7 @@ class ReadableStreamDefaultReader {
}

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

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

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

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

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

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

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