-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
repl: Proposal for better repl (implementation) #8504
Conversation
995ffff
to
2650113
Compare
80981b5
to
52b4c0d
Compare
c133999
to
83c7a88
Compare
4b2370c
to
dd903bf
Compare
dd903bf
to
d2c573a
Compare
CI: https://ci.nodejs.org/job/node-test-pull-request/4794/ CC: @nodejs/collaborators |
* Welcome message with version and help guide * `displayWelcomeMessage` flag is used to turn on/off * Differentiate execute & continue actions * ^M or enter key to execute the command * ^J to continue building multiline expression. * `executeOnTimeout` value is used to determine the end of expression when `terminal` is false. * Pretty stack trace. * REPL specific stack frames are removed before emitting to output stream. * Recoverable errors. * No more recoverable errors & no false positives. * Defined commands(like .exit, .load) are meaningful only at the top level. * Remove `.break` command and `.clear`when `useGlobal` is false. Welcome message template ------------------------ ```js $ node Welcome to Node.js <<version>> (<<vm name>> VM, <<vm version>>) Type ^M or enter to execute, ^J to continue, ^C to exit Or try ``` Pretty stack trace ------------------ ```js $ node -i > throw new Error('tiny stack') Error: tiny stack at repl:1:7 > var x y; var x y; ^ SyntaxError: Unexpected identifier > ```
d2c573a
to
429e046
Compare
The changes here are pretty extensive, are you sure you don't want to split this into several smaller PRs? It's pretty hard to review the different functionality changes this way. I also think you probably want to elaborate on why magic mode was removed. I'm generally +1 on the changes but I think this is significant enough to discuss in a CTC meeting. |
@benjamingr 90% of the changes are adding/fixing tests. I don't know how to split it into smaller PRs. Magic mode has no effect and is discussed in #7850 |
@addaleax @Fishrock123 @thefourtheye Have a look! |
Closing it. I'll create a new PR so that collaborators can have a look from recent list. |
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
repl
Description of change
displayWelcomeMessage
flag is used toturn on/off
executeOnTimeout
value is used to determinethe end of expression when
terminal
is false.emitting to output stream.
.break
is removed - no more get stuck.clear
is available only for local contextWelcome message template
Pretty stack trace
Refs: #8195
~~~TODO~~~