fs: fix fs.read when passing null value

PR-URL: https://github.com/nodejs/node/pull/32479
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
This commit is contained in:
himself65 authored and Anna Henningsen committed 2020-03-30 17:10:25 +02:00
1 parent fb254d2a83
commit defbc2ed82
2 files changed
+14 -4

No files matched your search

+8
View File
@@ -80,6 +80,14 @@ assert.throws(
}
);
['buffer', 'offset', 'length'].forEach((option) =>
assert.throws(
() => fs.read(fd, {
[option]: null
}),
`not throws when options.${option} is null`
));
assert.throws(
() => fs.read(null, Buffer.alloc(1), 0, 1, 0),
{