summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_read.ts
diff options
context:
space:
mode:
authorsigmaSd <bedisnbiba@gmail.com>2023-10-22 09:02:55 +0100
committerGitHub <noreply@github.com>2023-10-22 08:02:55 +0000
commit9f9c3d9048108200a888c508328d2a19cbbd6164 (patch)
tree664847bcef81d34a26d5371378d460b61245eac3 /ext/node/polyfills/_fs/_fs_read.ts
parentfb73eb1e9dca3e93cc7efcf5c2244e0068733843 (diff)
fix(polyfill): correctly handle flag when its equal 0 (#20953)
Fixes https://github.com/denoland/deno/issues/20910
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_read.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_read.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/polyfills/_fs/_fs_read.ts b/ext/node/polyfills/_fs/_fs_read.ts
index 6d7efbeef..66d5a4093 100644
--- a/ext/node/polyfills/_fs/_fs_read.ts
+++ b/ext/node/polyfills/_fs/_fs_read.ts
@@ -167,7 +167,7 @@ export function readSync(
if (typeof offsetOrOpt === "number") {
offset = offsetOrOpt;
validateInteger(offset, "offset", 0);
- } else {
+ } else if (offsetOrOpt !== undefined) {
const opt = offsetOrOpt as readSyncOptions;
offset = opt.offset ?? 0;
length = opt.length ?? buffer.byteLength;