@@ -21,7 +21,12 @@ const {
2121} = require ( 'internal/errors' ) ;
2222
2323const { FSReqCallback } = binding ;
24- const internalUtil = require ( 'internal/util' ) ;
24+ const {
25+ assignFunctionName,
26+ promisify,
27+ SymbolAsyncDispose,
28+ SymbolDispose,
29+ } = require ( 'internal/util' ) ;
2530const {
2631 getDirent,
2732 getOptions,
@@ -31,10 +36,6 @@ const {
3136 validateFunction,
3237 validateUint32,
3338} = require ( 'internal/validators' ) ;
34- const {
35- SymbolAsyncDispose,
36- SymbolDispose,
37- } = internalUtil ;
3839
3940class Dir {
4041 #handle;
@@ -61,9 +62,9 @@ class Dir {
6162 validateUint32 ( this . #options. bufferSize , 'options.bufferSize' , true ) ;
6263
6364 this . #readPromisified = FunctionPrototypeBind (
64- internalUtil . promisify ( this . #readImpl) , this , false ) ;
65+ promisify ( this . #readImpl) , this , false ) ;
6566 this . #closePromisified = FunctionPrototypeBind (
66- internalUtil . promisify ( this . close ) , this ) ;
67+ promisify ( this . close ) , this ) ;
6768 }
6869
6970 get path ( ) {
@@ -306,12 +307,16 @@ ObjectDefineProperties(Dir.prototype, {
306307 [ SymbolDispose ] : {
307308 __proto__ : null ,
308309 ...nonEnumerableDescriptor ,
309- value : Dir . prototype . closeSync ,
310+ value : assignFunctionName ( SymbolDispose , function ( ) {
311+ this . closeSync ( ) ;
312+ } ) ,
310313 } ,
311314 [ SymbolAsyncDispose ] : {
312315 __proto__ : null ,
313316 ...nonEnumerableDescriptor ,
314- value : Dir . prototype . close ,
317+ value : assignFunctionName ( SymbolAsyncDispose , function ( ) {
318+ this . close ( ) ;
319+ } ) ,
315320 } ,
316321 [ SymbolAsyncIterator ] : {
317322 __proto__ : null ,
0 commit comments