Skip to content

Commit

Permalink
fs: use Promise.resolve from primordials
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 authored and joesepi committed Oct 22, 2020
1 parent 2a9e6b6 commit 3a2db56
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 3a2db56

Please sign in to comment.