Skip to content

Commit becca06

Browse files
mroderickBethGriggs
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 ddd271e commit becca06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/fs/promises.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
528528
offset = 0,
529529
length = buffer.byteLength - offset,
530530
position = null
531-
} = offset ?? ObjectCreate(null));
531+
} = offset);
532532
}
533533

534534
if (offset == null) {

0 commit comments

Comments
 (0)