diff options
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2009,12 +2009,12 @@ function ReadStream(path, options) { this.closed = false; if (this.start !== undefined) { - if (typeof this.start !== 'number') { + if (typeof this.start !== 'number' || Number.isNaN(this.start)) { throw new ERR_INVALID_ARG_TYPE('start', 'number', this.start); } if (this.end === undefined) { this.end = Infinity; - } else if (typeof this.end !== 'number') { + } else if (typeof this.end !== 'number' || Number.isNaN(this.end)) { throw new ERR_INVALID_ARG_TYPE('end', 'number', this.end); } @@ -2031,6 +2031,8 @@ function ReadStream(path, options) { // (That is a semver-major change). if (typeof this.end !== 'number') this.end = Infinity; + else if (Number.isNaN(this.end)) + throw new ERR_INVALID_ARG_TYPE('end', 'number', this.end); if (typeof this.fd !== 'number') this.open(); |