Skip to content

Commit

Permalink
squash: inline null coalescing
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Apr 18, 2022
1 parent 6a974c2 commit 0f586d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,12 @@ async function read(handle, bufferOrParams, offset, length, position) {
let buffer = bufferOrParams;
if (!isArrayBufferView(buffer)) {
// This is fh.read(params)
bufferOrParams ??= ObjectCreate(null);
({
buffer = Buffer.alloc(16384),
offset = 0,
length = buffer.byteLength - offset,
position = null
} = bufferOrParams);
} = bufferOrParams ?? ObjectCreate(null));

validateBuffer(buffer);
}
Expand Down

0 comments on commit 0f586d2

Please sign in to comment.