File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,22 @@ class Dir {
166
166
pathModule . toNamespacedPath ( dirent . path ) ,
167
167
this [ kDirOptions ] . encoding ,
168
168
undefined ,
169
- ctx ,
169
+ ctx
170
170
) ;
171
171
handleErrorFromBinding ( ctx ) ;
172
- const result = handle . read (
173
- this [ kDirOptions ] . encoding ,
174
- this [ kDirOptions ] . bufferSize ,
175
- undefined ,
176
- ctx ,
177
- ) ;
172
+ while ( true ) {
173
+ const result = handle . read (
174
+ this [ kDirOptions ] . encoding ,
175
+ this [ kDirOptions ] . bufferSize ,
176
+ undefined ,
177
+ ctx ,
178
+ ) ;
178
179
179
- if ( result ) {
180
- this . processReadResult ( dirent . path , result ) ;
180
+ if ( result ) {
181
+ this . processReadResult ( dirent . path , result ) ;
182
+ } else {
183
+ break ;
184
+ }
181
185
}
182
186
183
187
handle . close ( undefined , ctx ) ;
@@ -206,7 +210,7 @@ class Dir {
206
210
this [ kDirOptions ] . encoding ,
207
211
this [ kDirOptions ] . bufferSize ,
208
212
undefined ,
209
- ctx ,
213
+ ctx
210
214
) ;
211
215
handleErrorFromBinding ( ctx ) ;
212
216
You can’t perform that action at this time.
0 commit comments