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 <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]>
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)