zlib: fix node crashing on invalid options
This PR fixes the Node process crashing when constructors of classes of the zlib
module are given invalid options.
- Throw an Error when the zlib library rejects the value of
windowBits
, instead of crashing with an assertion. - Treat
windowBits
andmemLevel
options consistently with other ones and don't crash when non-numeric values are given.
Fixes: https://github.com/nodejs/node/issues/13082
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
zlib