-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throw null
and throw undefined
crash in repl
#16545
Comments
@IonicaBizau Look for a try/catch block around that line in lib/repl.js (I mean the first line of the stack trace) and please add one or two regression tests in test/parallel/test-repl.js. Don't hesitate to ask if you have questions. |
@bnoordhuis Thank you very much! Will work on it these days. |
@IonicaBizau i already got it fixed. Need to make a pull request after making test and linting |
@cPhost Ah, cool! 👍 Thanks! |
When `throw undefined` or `throw null` is executed, the REPL crashes. This change does a check for `null|undefined` before accessing an error's properties to prevent crashing. Fixes: nodejs/node#16545 Fixes: nodejs/node#16607 PR-URL: nodejs/node#16574 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
When `throw undefined` or `throw null` is executed, the REPL crashes. This change does a check for `null|undefined` before accessing an error's properties to prevent crashing. Fixes: nodejs/node#16545 Fixes: nodejs/node#16607 PR-URL: nodejs/node#16574 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
When `throw undefined` or `throw null` is executed, the REPL crashes. This change does a check for `null|undefined` before accessing an error's properties to prevent crashing. Fixes: nodejs#16545 Fixes: nodejs#16607 PR-URL: nodejs#16574 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
When `throw undefined` or `throw null` is executed, the REPL crashes. This change does a check for `null|undefined` before accessing an error's properties to prevent crashing. Fixes: #16545 Fixes: #16607 PR-URL: #16574 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
When `throw undefined` or `throw null` is executed, the REPL crashes. This change does a check for `null|undefined` before accessing an error's properties to prevent crashing. Fixes: nodejs/node#16545 Fixes: nodejs/node#16607 PR-URL: nodejs/node#16574 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
While
setTimeout(function(){throw null},0)
doesn't crash anymore (as reported in #12373 and fixed in #14306),throw null
(alsothrow undefined
) seem to crash the toplevel.I'd be happy to contribute if you give me a bit of guidance. 😄
The text was updated successfully, but these errors were encountered: