Skip to content

Commit

Permalink
fs: use Promise.resolve from primordials
Browse files Browse the repository at this point in the history
PR-URL: #35379
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
targos committed Sep 30, 2020
1 parent ee9e3e7 commit 6c91991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
MathMin,
NumberIsSafeInteger,
Promise,
PromiseResolve,
Symbol,
Uint8Array,
} = primordials;
Expand Down Expand Up @@ -155,7 +156,7 @@ class FileHandle extends JSTransferable {

close = () => {
if (this[kFd] === -1) {
return Promise.resolve();
return PromiseResolve();
}

if (this[kClosePromise]) {
Expand Down

0 comments on commit 6c91991

Please sign in to comment.