Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: inline null coalescing
  • Loading branch information
LiviaMedeiros committed Apr 18, 2022
commit 0f586d2585aa10803f9ecb6268635c7f059e408a
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