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 <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
targos authored and danielleadams committed Oct 6, 2020
1 parent 91b820e commit e4a4f81
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 e4a4f81

Please sign in to comment.