Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5cfcf6f

Browse filesBrowse 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
Copy full SHA for 5cfcf6f

File tree

Expand file treeCollapse file tree

4 files changed

+10
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-8
lines changed
Open diff view settings
Collapse file

‎lib/_stream_readable.js‎

Copy file name to clipboardExpand all lines: lib/_stream_readable.js
+2-2Lines 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
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');
Collapse file

‎lib/internal/fs/dir.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/dir.js
+2-1Lines 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
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,
Collapse file

‎lib/internal/streams/from.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/from.js
+3-3Lines 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
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
Collapse file

‎lib/readline.js‎

Copy file name to clipboardExpand all lines: lib/readline.js
+3-2Lines 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-
return this[kLineObjectStream][Symbol.asyncIterator]();
1122+
return this[kLineObjectStream][SymbolAsyncIterator]();
11221123
};
11231124

11241125
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.