fs: refactor to use ES2020 syntax

PR-URL: https://github.com/nodejs/node/pull/41903
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
小菜 authored and Danielle Adams committed 2022-04-23 22:25:58 -04:00
1 parent 6fc0a25b64
commit 2d165652f1
1 file changed
+2 -3
+2 -3
View File
@@ -2516,7 +2516,7 @@ function realpathSync(p, options) {
}
resolvedLink = pathModule.resolve(previous, linkTarget);
if (cache) cache.set(base, resolvedLink);
cache?.set(base, resolvedLink);
if (!isWindows) seenLinks[id] = linkTarget;
}
@@ -3041,8 +3041,7 @@ ObjectDefineProperties(fs, {
configurable: true,
enumerable: true,
get() {
if (promises === null)
promises = require('internal/fs/promises').exports;
promises ??= require('internal/fs/promises').exports;
return promises;
}
}