Skip to content

Commit fa0cac5

Browse files
committed
fs: lazy load createPromise/promiseResolve
PR-URL: #20766 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 11aea01 commit fa0cac5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const {
4444
const util = require('util');
4545
const pathModule = require('path');
4646
const { isUint8Array } = require('internal/util/types');
47-
const { createPromise, promiseResolve } = process.binding('util');
4847

4948
const binding = process.binding('fs');
5049
const fs = exports;
@@ -250,6 +249,7 @@ fs.exists = function(path, callback) {
250249

251250
Object.defineProperty(fs.exists, internalUtil.promisify.custom, {
252251
value: (path) => {
252+
const { createPromise, promiseResolve } = process.binding('util');
253253
const promise = createPromise();
254254
fs.exists(path, (exists) => promiseResolve(promise, exists));
255255
return promise;

0 commit comments

Comments
 (0)