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