Skip to content

fs: make ReadStream throw TypeError on NaN

Rodrigo Muino Tomonari requested to merge github/fork/ryzokuken/fix-isnan into master

Make ReadStream (and thus createReadStream) throw a TypeError signalling towards an invalid argument type when either options.start or options.end (or obviously, both) are set to NaN. Also add regression tests for the same.

Fixes: https://github.com/nodejs/node/issues/19715

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

/cc @lpinca @BridgeAR @addaleax @anliting

Merge request reports

Loading