Skip to content

Commit 5cfcf6f

Browse files
Sebastien-Ahkrintargos
authored andcommitted
lib: replace Symbol.asyncIterator by SymbolAsyncIterator
PR-URL: #30947 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 31227e6 commit 5cfcf6f

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

lib/_stream_readable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {
2727
NumberIsNaN,
2828
ObjectDefineProperty,
2929
ObjectSetPrototypeOf,
30-
Symbol,
30+
SymbolAsyncIterator,
3131
} = primordials;
3232

3333
module.exports = Readable;
@@ -1073,7 +1073,7 @@ Readable.prototype.wrap = function(stream) {
10731073
return this;
10741074
};
10751075

1076-
Readable.prototype[Symbol.asyncIterator] = function() {
1076+
Readable.prototype[SymbolAsyncIterator] = function() {
10771077
if (createReadableStreamAsyncIterator === undefined) {
10781078
createReadableStreamAsyncIterator =
10791079
require('internal/streams/async_iterator');

lib/internal/fs/dir.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
ObjectDefineProperty,
55
Symbol,
6+
SymbolAsyncIterator,
67
} = primordials;
78

89
const pathModule = require('path');
@@ -175,7 +176,7 @@ class Dir {
175176
}
176177
}
177178

178-
ObjectDefineProperty(Dir.prototype, Symbol.asyncIterator, {
179+
ObjectDefineProperty(Dir.prototype, SymbolAsyncIterator, {
179180
value: Dir.prototype.entries,
180181
enumerable: false,
181182
writable: true,

lib/internal/streams/from.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const {
4-
Symbol,
4+
SymbolAsyncIterator,
55
SymbolIterator
66
} = primordials;
77

@@ -11,8 +11,8 @@ const {
1111

1212
function from(Readable, iterable, opts) {
1313
let iterator;
14-
if (iterable && iterable[Symbol.asyncIterator])
15-
iterator = iterable[Symbol.asyncIterator]();
14+
if (iterable && iterable[SymbolAsyncIterator])
15+
iterator = iterable[SymbolAsyncIterator]();
1616
else if (iterable && iterable[SymbolIterator])
1717
iterator = iterable[SymbolIterator]();
1818
else

lib/readline.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const {
3737
ObjectDefineProperty,
3838
ObjectSetPrototypeOf,
3939
Symbol,
40+
SymbolAsyncIterator,
4041
} = primordials;
4142

4243
const {
@@ -1088,7 +1089,7 @@ Interface.prototype._ttyWrite = function(s, key) {
10881089
}
10891090
};
10901091

1091-
Interface.prototype[Symbol.asyncIterator] = function() {
1092+
Interface.prototype[SymbolAsyncIterator] = function() {
10921093
if (this[kLineObjectStream] === undefined) {
10931094
if (Readable === undefined) {
10941095
Readable = require('stream').Readable;
@@ -1118,7 +1119,7 @@ Interface.prototype[Symbol.asyncIterator] = function() {
11181119
this[kLineObjectStream] = readable;
11191120
}
11201121

1121-
return this[kLineObjectStream][Symbol.asyncIterator]();
1122+
return this[kLineObjectStream][SymbolAsyncIterator]();
11221123
};
11231124

11241125
/**

0 commit comments

Comments
 (0)