Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorgan Roderick <20321+mroderick@users.noreply.github.com>2022-05-15 07:25:53 +0300
committerBeth Griggs <bgriggs@redhat.com>2022-05-16 13:12:18 +0300
commitbecca06f9ba917e5a68e0f6b6212f31b0e1cb504 (patch)
tree8866ec7b582495e30359b65d04e72fd8f515e3aa /lib
parentddd271ec2bf9d7ed1c7e8c2eeb2266c0d6682d8e (diff)
fs: remove unnecessary ?? operator
This was introduced in 57678e55817366c39a3a241f89949c8fbe8418bc 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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/fs/promises.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js
index ea9482e69dc..9ae66a8e073 100644
--- a/lib/internal/fs/promises.js
+++ b/lib/internal/fs/promises.js
@@ -528,7 +528,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
offset = 0,
length = buffer.byteLength - offset,
position = null
- } = offset ?? ObjectCreate(null));
+ } = offset);
}
if (offset == null) {