Skip to content

Commit 835056c

Browse files
mrodericktargos
authored andcommitted
fs: remove unnecessary ?? operator
This was introduced in 57678e5 With the `if` conditional around this statement, `options` will always be evaluated as truthy. That means that the nullish coalescing operator will always evaluate to the left side, make it unnecessary. PR-URL: #43073 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
1 parent 7d5e7b4 commit 835056c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/fs/promises.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
478478
offset = 0,
479479
length = buffer.byteLength - offset,
480480
position = null,
481-
} = offset ?? ObjectCreate(null));
481+
} = offset);
482482
}
483483

484484
if (offset == null) {

0 commit comments

Comments
 (0)