@@ -23,7 +23,10 @@ const {
2323} = require ( 'internal/errors' ) ;
2424
2525const { FSReqCallback } = binding ;
26- const internalUtil = require ( 'internal/util' ) ;
26+ const {
27+ assignFunctionName,
28+ promisify,
29+ } = require ( 'internal/util' ) ;
2730const {
2831 getDirent,
2932 getOptions,
@@ -59,9 +62,9 @@ class Dir {
5962 validateUint32 ( this . #options. bufferSize , 'options.bufferSize' , true ) ;
6063
6164 this . #readPromisified = FunctionPrototypeBind (
62- internalUtil . promisify ( this . #readImpl) , this , false ) ;
65+ promisify ( this . #readImpl) , this , false ) ;
6366 this . #closePromisified = FunctionPrototypeBind (
64- internalUtil . promisify ( this . close ) , this ) ;
67+ promisify ( this . close ) , this ) ;
6568 }
6669
6770 get path ( ) {
@@ -304,12 +307,16 @@ ObjectDefineProperties(Dir.prototype, {
304307 [ SymbolDispose ] : {
305308 __proto__ : null ,
306309 ...nonEnumerableDescriptor ,
307- value : Dir . prototype . closeSync ,
310+ value : assignFunctionName ( SymbolDispose , function ( ) {
311+ this . closeSync ( ) ;
312+ } ) ,
308313 } ,
309314 [ SymbolAsyncDispose ] : {
310315 __proto__ : null ,
311316 ...nonEnumerableDescriptor ,
312- value : Dir . prototype . close ,
317+ value : assignFunctionName ( SymbolAsyncDispose , function ( ) {
318+ this . close ( ) ;
319+ } ) ,
313320 } ,
314321 [ SymbolAsyncIterator ] : {
315322 __proto__ : null ,
0 commit comments