diff options
-rw-r--r-- | lib/fs.js | 6 | ||||
-rw-r--r-- | test/parallel/test-fs-stat.js | 11 |
2 files changed, 14 insertions, 3 deletions
@@ -796,7 +796,7 @@ function readdirSync(path, options) { return options.withFileTypes ? getDirents(path, result) : result; } -function fstat(fd, options, callback) { +function fstat(fd, options = { bigint: false }, callback) { if (typeof options === 'function') { callback = options; options = {}; @@ -807,7 +807,7 @@ function fstat(fd, options, callback) { binding.fstat(fd, options.bigint, req); } -function lstat(path, options, callback) { +function lstat(path, options = { bigint: false }, callback) { if (typeof options === 'function') { callback = options; options = {}; @@ -819,7 +819,7 @@ function lstat(path, options, callback) { binding.lstat(pathModule.toNamespacedPath(path), options.bigint, req); } -function stat(path, options, callback) { +function stat(path, options = { bigint: false }, callback) { if (typeof options === 'function') { callback = options; options = {}; diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index d52eb6d8fd..bde3e06765 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -154,3 +154,14 @@ fs.stat(__filename, common.mustCall(function(err, s) { } ); }); + +// Should not throw an error +fs.stat(__filename, undefined, common.mustCall(() => {})); + +fs.open(__filename, 'r', undefined, common.mustCall((err, fd) => { + // Should not throw an error + fs.fstat(fd, undefined, common.mustCall(() => {})); +})); + +// Should not throw an error +fs.lstat(__filename, undefined, common.mustCall(() => {})); |