summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fs.js')
-rw-r--r--lib/fs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 67c96a7524..ac0d42c76a 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -981,7 +981,7 @@ fs.readdirSync = function(path, options) {
};
fs.fstat = function(fd, callback) {
- if (typeof fd !== 'number')
+ if (!Number.isInteger(fd))
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'fd', 'number');
if (fd < 0 || fd > 0xFFFFFFFF)
throw new errors.RangeError('ERR_OUT_OF_RANGE', 'fd');
@@ -1011,7 +1011,7 @@ fs.stat = function(path, callback) {
};
fs.fstatSync = function(fd) {
- if (typeof fd !== 'number')
+ if (!Number.isInteger(fd))
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'fd', 'number');
if (fd < 0 || fd > 0xFFFFFFFF)
throw new errors.RangeError('ERR_OUT_OF_RANGE', 'fd');