stream: resolve perf regression introduced by V8 7.3
This commit contains two fixes:
- use instanceof instead of Object.getPrototypeOf, as checking an object prototype with Object.getPrototypeOf is slower than an instanceof check.
- avoid parseInt(undefined, 10) to get NaN as it regressed.
Fixes: https://github.com/nodejs/node/issues/28586
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines