repl: Proposal for better repl (implementation) #8504
Closed
princejwesley wants to merge 2 commits intonodejs:masterfrom
Closed
repl: Proposal for better repl (implementation) #8504princejwesley wants to merge 2 commits intonodejs:masterfrom
princejwesley wants to merge 2 commits intonodejs:masterfrom
Conversation
995ffff to
2650113
Compare
80981b5 to
52b4c0d
Compare
c133999 to
83c7a88
Compare
4b2370c to
dd903bf
Compare
dd903bf to
d2c573a
Compare
Contributor
Author
|
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
Member
|
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. |
Contributor
Author
|
@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 |
Contributor
Author
|
@addaleax @Fishrock123 @thefourtheye Have a look! |
Contributor
Author
|
Closing it. I'll create a new PR so that collaborators can have a look from recent list. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
repl
Description of change
displayWelcomeMessageflag is used toturn on/off
executeOnTimeoutvalue is used to determinethe end of expression when
terminalis false.emitting to output stream.
.breakis removed - no more get stuck.clearis available only for local contextWelcome message template
Pretty stack trace
Refs: #8195
~~~TODO~~~