Skip to content

Commit

Permalink
fs: refactor to use ES2020 syntax
Browse files Browse the repository at this point in the history
PR-URL: #41903
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
xtx1130 authored and danielleadams committed Apr 21, 2022
1 parent ec6fd4a commit 57f71da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 57f71da

Please sign in to comment.