@@ -21,7 +21,12 @@ const {
21
21
} = require ( 'internal/errors' ) ;
22
22
23
23
const { FSReqCallback } = binding ;
24
- const internalUtil = require ( 'internal/util' ) ;
24
+ const {
25
+ assignFunctionName,
26
+ promisify,
27
+ SymbolAsyncDispose,
28
+ SymbolDispose,
29
+ } = require ( 'internal/util' ) ;
25
30
const {
26
31
getDirent,
27
32
getOptions,
@@ -31,10 +36,6 @@ const {
31
36
validateFunction,
32
37
validateUint32,
33
38
} = require ( 'internal/validators' ) ;
34
- const {
35
- SymbolAsyncDispose,
36
- SymbolDispose,
37
- } = internalUtil ;
38
39
39
40
class Dir {
40
41
#handle;
@@ -61,9 +62,9 @@ class Dir {
61
62
validateUint32 ( this . #options. bufferSize , 'options.bufferSize' , true ) ;
62
63
63
64
this . #readPromisified = FunctionPrototypeBind (
64
- internalUtil . promisify ( this . #readImpl) , this , false ) ;
65
+ promisify ( this . #readImpl) , this , false ) ;
65
66
this . #closePromisified = FunctionPrototypeBind (
66
- internalUtil . promisify ( this . close ) , this ) ;
67
+ promisify ( this . close ) , this ) ;
67
68
}
68
69
69
70
get path ( ) {
@@ -306,12 +307,16 @@ ObjectDefineProperties(Dir.prototype, {
306
307
[ SymbolDispose ] : {
307
308
__proto__ : null ,
308
309
...nonEnumerableDescriptor ,
309
- value : Dir . prototype . closeSync ,
310
+ value : assignFunctionName ( SymbolDispose , function ( ) {
311
+ this . closeSync ( ) ;
312
+ } ) ,
310
313
} ,
311
314
[ SymbolAsyncDispose ] : {
312
315
__proto__ : null ,
313
316
...nonEnumerableDescriptor ,
314
- value : Dir . prototype . close ,
317
+ value : assignFunctionName ( SymbolAsyncDispose , function ( ) {
318
+ this . close ( ) ;
319
+ } ) ,
315
320
} ,
316
321
[ SymbolAsyncIterator ] : {
317
322
__proto__ : null ,
0 commit comments