Skip to content

Commit 92475e9

Browse files
Sebastien-AhkrinMylesBorins
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 19f05ca commit 92475e9

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;
@@ -1096,7 +1096,7 @@ Readable.prototype.wrap = function(stream) {
10961096
return this;
10971097
};
10981098

1099-
Readable.prototype[Symbol.asyncIterator] = function() {
1099+
Readable.prototype[SymbolAsyncIterator] = function() {
11001100
if (createReadableStreamAsyncIterator === undefined) {
11011101
createReadableStreamAsyncIterator =
11021102
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
const { Buffer } = require('buffer');
@@ -23,8 +23,8 @@ function from(Readable, iterable, opts) {
2323
});
2424
}
2525

26-
if (iterable && iterable[Symbol.asyncIterator])
27-
iterator = iterable[Symbol.asyncIterator]();
26+
if (iterable && iterable[SymbolAsyncIterator])
27+
iterator = iterable[SymbolAsyncIterator]();
2828
else if (iterable && iterable[SymbolIterator])
2929
iterator = iterable[SymbolIterator]();
3030
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 {
@@ -1078,7 +1079,7 @@ Interface.prototype._ttyWrite = function(s, key) {
10781079
}
10791080
};
10801081

1081-
Interface.prototype[Symbol.asyncIterator] = function() {
1082+
Interface.prototype[SymbolAsyncIterator] = function() {
10821083
if (this[kLineObjectStream] === undefined) {
10831084
if (Readable === undefined) {
10841085
Readable = require('stream').Readable;
@@ -1108,7 +1109,7 @@ Interface.prototype[Symbol.asyncIterator] = function() {
11081109
this[kLineObjectStream] = readable;
11091110
}
11101111

1111-
return this[kLineObjectStream][Symbol.asyncIterator]();
1112+
return this[kLineObjectStream][SymbolAsyncIterator]();
11121113
};
11131114

11141115
/**

0 commit comments

Comments
 (0)