From 9636a35e0ff501f55870b9eafe94d520eebf4b76 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 29 Mar 2019 17:14:48 +0100 Subject: [PATCH 1/2] stream: make async iteration stable --- doc/api/stream.md | 6 +++++- lib/_stream_readable.js | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index df171b95369741..e0cc35892cfe7e 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1270,9 +1270,13 @@ myReader.on('readable', () => { ##### readable\[Symbol.asyncIterator\]() -> Stability: 1 - Experimental +> Stability: 2 - Stable * Returns: {AsyncIterator} to fully consume the stream. diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 81e8de310c240f..d813bcc07f6083 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -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'); From 8df8328b142fd759189fd70dd30cce779f4c9583 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Mon, 1 Apr 2019 10:07:57 +0200 Subject: [PATCH 2/2] readline: make AsyncIterator stable --- doc/api/readline.md | 6 +++++- lib/readline.js | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 4db4b0f899cae6..b14a4007922f41 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -312,9 +312,13 @@ The `rl.write()` method will write the data to the `readline` `Interface`'s ### rl\[Symbol.asyncIterator\]() -> Stability: 1 - Experimental +> Stability: 2 - Stable * Returns: {AsyncIterator} diff --git a/lib/readline.js b/lib/readline.js index 67e71fee4164fc..8539e84daa5420 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -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;