lib: fix issue `throw null` and `throw undefined` and also `throw false` crash in repl
The issue was that when it tries to check if err.message == 'Script execution interrupted.'
line 269 repl.js it throws error as e would be null
or undefined
. Now before it checks
the err.message it checks if err was null|undefined
and id so returns err before checking
and exits,
# sample output repl
> throw null
Thrown: null
> throw undefined
Thrown: undefined
Fixes: https://github.com/nodejs/node/issues/16545 Fixes: https://github.com/nodejs/node/issues/16607
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes For make -j4 testmake error 1 Flaky test-timers-block-eventloop
https://github.com/nodejs/node/issues/16310 -
commit message follows commit guidelines
Affected core subsystem(s)
repl