Skip to content

Commit cdda735

Browse files
mroderickjuanarbol
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 b56a91a commit cdda735

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
@@ -476,7 +476,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
476476
offset = 0,
477477
length = buffer.byteLength - offset,
478478
position = null
479-
} = offset ?? ObjectCreate(null));
479+
} = offset);
480480
}
481481

482482
if (offset == null) {

0 commit comments

Comments
 (0)