Skip to content

Commit 9b43af3

Browse files
jasnellMylesBorins
authored andcommitted
fs: lazy load createPromise/promiseResolve
PR-URL: #20766 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 2d28978 commit 9b43af3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/fs.js‎

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

4948
constbinding=process.binding('fs');
5049
constfs=exports;
@@ -248,6 +247,7 @@ fs.exists = function(path, callback) {
248247

249248
Object.defineProperty(fs.exists,internalUtil.promisify.custom,{
250249
value: (path)=>{
250+
const{ createPromise, promiseResolve }=process.binding('util');
251251
constpromise=createPromise();
252252
fs.exists(path,(exists)=>promiseResolve(promise,exists));
253253
returnpromise;

0 commit comments

Comments
 (0)