Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
repl: make last error available as _error#18919
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
addaleax commented Feb 21, 2018
doc/api/repl.md Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could add a Changes section for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanlucas done!
Fishrock123 commented Feb 21, 2018
Would it be a good idea to make it something... less likely to conflict? |
addaleax commented Feb 21, 2018
@Fishrock123 How would |
vdeturckheim left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it
jasnell commented Feb 22, 2018
Love the idea, needs a better name. Two underscores is better than one and would prefer something like |
addaleax commented Feb 22, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@jasnell I think the main goal for the name is that it’s supposed to be typable really, really easily and quickly. I love verbose names in real code, because we’re writing it for the 100 readers coming after us, but the REPL has the exact opposite goal of that: It’s code that’s only written once, ever, and never read by anybody else more than a minute after it was written. It’s not about choosing good or descriptive variable names in any way, it’s about being easy to write, so I would really prefer to keep it short and succinct. (Literally all REPLs that I know of use The only thing I’m worried about here is discoverability, because right now you’d have to hear about it somewhere or read the docs. I’ve gone with I’m also not worried about collisions; there is an explicit warning text being emitted here if that happens, like it is for |
tniessen left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with either name.
jasnell commented Feb 26, 2018
@addaleax ... then how about meeting in the middle with |
0bb0ec2 to 1aaf085Compareaddaleax commented Feb 26, 2018
@jasnell I’m fine with that, but honestly, I’m just going to write I’ve switched it for now but it might be helpful to know what your concerns actually are. |
jasnell commented Feb 26, 2018
The concern is that I'm not particularly fond of abbreviated things. |
TimothyGu commented Feb 26, 2018
How about |
This is pretty useful when trying to inspect the last error caught by a REPL, and is made to be analogous to `_`, which contains the last successful completion value.
_err_error1aaf085 to 1867690Compareaddaleax commented Feb 26, 2018
@TimothyGu I think @jasnell would want that to be |
BridgeAR commented Mar 2, 2018
addaleax commented Mar 2, 2018
It seems like the CI run here was started for a different PR. |
addaleax commented Mar 4, 2018
Landed in a8b5192 |
This is pretty useful when trying to inspect the last error caught by a REPL, and is made to be analogous to `_`, which contains the last successful completion value. PR-URL: #18919 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Shingo Inoue <[email protected]>
This is pretty useful when trying to inspect the last error caught by a REPL, and is made to be analogous to `_`, which contains the last successful completion value. PR-URL: nodejs#18919 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Shingo Inoue <[email protected]>
MylesBorins commented Apr 13, 2018
Should this be backported to |
This is pretty useful when trying to inspect the last error caught by a REPL, and is made to be analogous to `_`, which contains the last successful completion value. PR-URL: nodejs#18919 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Shingo Inoue <[email protected]>
This is pretty useful when trying to inspect the last
error caught by a REPL, and is made to be analogous to
_,which contains the last successful completion value.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
repl