Skip to content

lib: fix issue `throw null` and `throw undefined` and also `throw false` crash in repl

Rodrigo Muino Tomonari requested to merge github/fork/priyank-p/repl-issue into master

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
Affected core subsystem(s)

repl

Merge request reports

Loading