Skip to content

Commit 5cfcf6f

Browse files
Sebastien-Ahkrintargos
authored andcommitted
lib: replace Symbol.asyncIterator by SymbolAsyncIterator
PR-URL: #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>
1 parent 31227e6 commit 5cfcf6f

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎lib/_stream_readable.js‎

Lines changed: 2 additions & 2 deletions
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
returnthis;
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‎

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

89
constpathModule=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‎

Lines changed: 3 additions & 3 deletions
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
functionfrom(Readable,iterable,opts){
1313
letiterator;
14-
if(iterable&&iterable[Symbol.asyncIterator])
15-
iterator=iterable[Symbol.asyncIterator]();
14+
if(iterable&&iterable[SymbolAsyncIterator])
15+
iterator=iterable[SymbolAsyncIterator]();
1616
elseif(iterable&&iterable[SymbolIterator])
1717
iterator=iterable[SymbolIterator]();
1818
else

‎lib/readline.js‎

Lines changed: 3 additions & 2 deletions
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-
returnthis[kLineObjectStream][Symbol.asyncIterator]();
1122+
returnthis[kLineObjectStream][SymbolAsyncIterator]();
11221123
};
11231124

11241125
/**

0 commit comments

Comments
 (0)