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

stream: make async iteration stable #26989

Closed
Closed
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
6 changes: 5 additions & 1 deletion doc/api/readline.md
Original file line number Diff line number Diff line change
@@ -312,9 +312,13 @@ The `rl.write()` method will write the data to the `readline` `Interface`'s
### rl\[Symbol.asyncIterator\]()
<!-- YAML
added: v11.4.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/26989
description: AsyncIterator support is not experimental anymore.
-->

> Stability: 1 - Experimental
> Stability: 2 - Stable
* Returns: {AsyncIterator}

6 changes: 5 additions & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
@@ -1270,9 +1270,13 @@ myReader.on('readable', () => {
##### readable\[Symbol.asyncIterator\]()
<!-- YAML
added: v10.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/26989
description: AsyncIterator support is not experimental anymore.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: AsyncIterator support is not experimental anymore.
description: AsyncIterator support is no longer experimental.

-->

> Stability: 1 - Experimental
> Stability: 2 - Stable
* Returns: {AsyncIterator} to fully consume the stream.

2 changes: 0 additions & 2 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,6 @@ const {
ERR_METHOD_NOT_IMPLEMENTED,
ERR_STREAM_UNSHIFT_AFTER_END_EVENT
} = require('internal/errors').codes;
const { emitExperimentalWarning } = require('internal/util');

// Lazy loaded to improve the startup performance.
let StringDecoder;
@@ -1036,7 +1035,6 @@ Readable.prototype.wrap = function(stream) {
};

Readable.prototype[Symbol.asyncIterator] = function() {
emitExperimentalWarning('Readable[Symbol.asyncIterator]');
if (createReadableStreamAsyncIterator === undefined) {
createReadableStreamAsyncIterator =
require('internal/streams/async_iterator');
3 changes: 0 additions & 3 deletions lib/readline.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ const {
} = require('internal/errors').codes;
const { validateString } = require('internal/validators');
const { inspect } = require('internal/util/inspect');
const { emitExperimentalWarning } = require('internal/util');
const EventEmitter = require('events');
const {
CSI,
@@ -1068,8 +1067,6 @@ Interface.prototype._ttyWrite = function(s, key) {
};

Interface.prototype[Symbol.asyncIterator] = function() {
emitExperimentalWarning('readline Interface [Symbol.asyncIterator]');

if (this[kLineObjectStream] === undefined) {
if (Readable === undefined) {
Readable = require('stream').Readable;