Skip to content

Commit 823ca69

Browse files
fs: make processReadResult() and readSyncRecursive() private
PR-URL: #58672 Fixes: #58671 Refs: #41439 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
1 parent 0b3fc0d commit 823ca69

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/internal/fs/dir.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Dir {
8282
);
8383

8484
if (result !== null) {
85-
this.processReadResult(path, result);
85+
this.#processReadResult(path, result);
8686
if (result.length > 0) {
8787
ArrayPrototypePush(this.#handlerQueue, handler);
8888
}
@@ -125,7 +125,7 @@ class Dir {
125125
const dirent = ArrayPrototypeShift(this.#bufferedEntries);
126126

127127
if (this.#options.recursive && dirent.isDirectory()) {
128-
this.readSyncRecursive(dirent);
128+
this.#readSyncRecursive(dirent);
129129
}
130130

131131
if (maybeSync)
@@ -151,10 +151,10 @@ class Dir {
151151
}
152152

153153
try {
154-
this.processReadResult(this.#path, result);
154+
this.#processReadResult(this.#path, result);
155155
const dirent = ArrayPrototypeShift(this.#bufferedEntries);
156156
if (this.#options.recursive && dirent.isDirectory()) {
157-
this.readSyncRecursive(dirent);
157+
this.#readSyncRecursive(dirent);
158158
}
159159
callback(null, dirent);
160160
} catch (error) {
@@ -170,7 +170,7 @@ class Dir {
170170
);
171171
}
172172

173-
processReadResult(path, result) {
173+
#processReadResult(path, result) {
174174
for (let i = 0; i < result.length; i += 2) {
175175
ArrayPrototypePush(
176176
this.#bufferedEntries,
@@ -183,7 +183,7 @@ class Dir {
183183
}
184184
}
185185

186-
readSyncRecursive(dirent) {
186+
#readSyncRecursive(dirent) {
187187
const path = pathModule.join(dirent.parentPath, dirent.name);
188188
const handle = dirBinding.opendir(
189189
path,
@@ -209,7 +209,7 @@ class Dir {
209209
if (this.#processHandlerQueue()) {
210210
const dirent = ArrayPrototypeShift(this.#bufferedEntries);
211211
if (this.#options.recursive && dirent.isDirectory()) {
212-
this.readSyncRecursive(dirent);
212+
this.#readSyncRecursive(dirent);
213213
}
214214
return dirent;
215215
}
@@ -223,11 +223,11 @@ class Dir {
223223
return result;
224224
}
225225

226-
this.processReadResult(this.#path, result);
226+
this.#processReadResult(this.#path, result);
227227

228228
const dirent = ArrayPrototypeShift(this.#bufferedEntries);
229229
if (this.#options.recursive && dirent.isDirectory()) {
230-
this.readSyncRecursive(dirent);
230+
this.#readSyncRecursive(dirent);
231231
}
232232
return dirent;
233233
}

0 commit comments

Comments
 (0)