Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSebastien Ahkrin <sebastien48criquet@gmail.com>2019-12-14 00:01:47 +0300
committerMichaël Zasso <targos@protonmail.com>2019-12-16 11:23:50 +0300
commit593240d1a146f71bc3bf1f4de55e7ed68d5c6410 (patch)
treebe9feb4fb2fc39267776815a551be89cf6eae7a6 /lib
parent7e5bf80fd1a06655564ea88f5d7867b3f4fc7da0 (diff)
lib: replace Symbol.asyncIterator by SymbolAsyncIterator
PR-URL: https://github.com/nodejs/node/pull/30947 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_stream_readable.js4
-rw-r--r--lib/internal/fs/dir.js3
-rw-r--r--lib/internal/streams/from.js6
-rw-r--r--lib/readline.js5
4 files changed, 10 insertions, 8 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index 1e42b15363f..5ed86c62b7a 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -27,7 +27,7 @@ const {
NumberIsNaN,
ObjectDefineProperty,
ObjectSetPrototypeOf,
- Symbol,
+ SymbolAsyncIterator,
} = primordials;
module.exports = Readable;
@@ -1099,7 +1099,7 @@ Readable.prototype.wrap = function(stream) {
return this;
};
-Readable.prototype[Symbol.asyncIterator] = function() {
+Readable.prototype[SymbolAsyncIterator] = function() {
if (createReadableStreamAsyncIterator === undefined) {
createReadableStreamAsyncIterator =
require('internal/streams/async_iterator');
diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js
index 749e22ee696..1351ce6c245 100644
--- a/lib/internal/fs/dir.js
+++ b/lib/internal/fs/dir.js
@@ -3,6 +3,7 @@
const {
ObjectDefineProperty,
Symbol,
+ SymbolAsyncIterator,
} = primordials;
const pathModule = require('path');
@@ -175,7 +176,7 @@ class Dir {
}
}
-ObjectDefineProperty(Dir.prototype, Symbol.asyncIterator, {
+ObjectDefineProperty(Dir.prototype, SymbolAsyncIterator, {
value: Dir.prototype.entries,
enumerable: false,
writable: true,
diff --git a/lib/internal/streams/from.js b/lib/internal/streams/from.js
index 474db60b893..ab6db00a125 100644
--- a/lib/internal/streams/from.js
+++ b/lib/internal/streams/from.js
@@ -1,7 +1,7 @@
'use strict';
const {
- Symbol,
+ SymbolAsyncIterator,
SymbolIterator
} = primordials;
const { Buffer } = require('buffer');
@@ -23,8 +23,8 @@ function from(Readable, iterable, opts) {
});
}
- if (iterable && iterable[Symbol.asyncIterator])
- iterator = iterable[Symbol.asyncIterator]();
+ if (iterable && iterable[SymbolAsyncIterator])
+ iterator = iterable[SymbolAsyncIterator]();
else if (iterable && iterable[SymbolIterator])
iterator = iterable[SymbolIterator]();
else
diff --git a/lib/readline.js b/lib/readline.js
index daf30969408..2823b246519 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -37,6 +37,7 @@ const {
ObjectDefineProperty,
ObjectSetPrototypeOf,
Symbol,
+ SymbolAsyncIterator,
} = primordials;
const {
@@ -1078,7 +1079,7 @@ Interface.prototype._ttyWrite = function(s, key) {
}
};
-Interface.prototype[Symbol.asyncIterator] = function() {
+Interface.prototype[SymbolAsyncIterator] = function() {
if (this[kLineObjectStream] === undefined) {
if (Readable === undefined) {
Readable = require('stream').Readable;
@@ -1108,7 +1109,7 @@ Interface.prototype[Symbol.asyncIterator] = function() {
this[kLineObjectStream] = readable;
}
- return this[kLineObjectStream][Symbol.asyncIterator]();
+ return this[kLineObjectStream][SymbolAsyncIterator]();
};
/**