Conversation
test/parallel/test-repl-sigint.js
Outdated
lib/repl.js
Outdated
There was a problem hiding this comment.
Well, things that are thrown aren't necessarily always errors. Maybe Thrown: or just ${e}\n?
(Also does this work with symbols?)
There was a problem hiding this comment.
@TimothyGu I preferred to make the smaller changed - for it to work with symbols we'd need to wrap it in String (I can do that).
I can change the terminology from Error: to Thrown: I was hoping we could get a little bikeshedding on the message.
There was a problem hiding this comment.
Yeah well, this kinda goes back to #13784, which is still in limbo because of the lack of a good way to stringify an object.
There was a problem hiding this comment.
@TimothyGu yes, but I think String is a good middle ground - I don't want it to be bulletproof - I want it to be useful for users.
lib/repl.js
Outdated
There was a problem hiding this comment.
Yeah well, this kinda goes back to #13784, which is still in limbo because of the lack of a good way to stringify an object.
There was a problem hiding this comment.
Is the process.nextTick necessary?
There was a problem hiding this comment.
@TimothyGu yes, to reproduce the issue - without the nextTick it doesn't crash the REPL.
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: nodejs#14306 Fixes: nodejs#12373 Reviewed-By: Anna Henningsen <anna@addaleax.net>
3200c5a to
4dfe7fd
Compare
|
@TimothyGu renamed "Error: " to "Thrown: " and handled thrown symbols. |
| const top = replMap.get(self); | ||
|
|
||
| internalUtil.decorateErrorStack(e); | ||
| const isError = internalUtil.isError(e); |
There was a problem hiding this comment.
Why not process.binding('util').isNativeError?
There was a problem hiding this comment.
@TimothyGu Not sure that's the behaviour I'd want - I'd like people to (optimally) be able to override Symbol.toStringTag (or even the name) and take the "Error like" path if they really need to.
I don't feel strongly about this though. If you do - let me know and I'll change it.
| replserver.emit('line', '.exit'); | ||
|
|
||
| setTimeout(() => { | ||
| console.log(text); |
There was a problem hiding this comment.
extraneous console.log() output?
|
I mean, we can still craft weird scenarios with |
|
Landed in 380e814. |
|
@TimothyGu note: you landed this without passing CI (last CI was failing due to changed error message). I've started a CI in https://ci.nodejs.org/job/node-test-pull-request/9246/console |
|
@benjamingr I didn't land this BTW, I just noticed it was landed w/o a "landed" comment. |
|
@TimothyGu I landed and immediately force reverted because of the CI (and posted in #node-dev) - currently waiting for CI to land this. |
|
@benjamingr Ah oops. Sorry, should've let you handle this (and checked IRC...) |
|
ARM fanned failure on |
|
Landed in 030a028 🎉 |
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306 Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306 Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306 Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
|
Should this be backported to |
|
ping @benjamingr |
1 similar comment
|
ping @benjamingr |
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
repl
Fixes #12373