Uh oh!
There was an error while loading. Please reload this page.
repl: Proposal for better repl (implementation) - #8504
Conversation
995ffff to
2650113Compare80981b5 to
52b4c0dComparec133999 to
83c7a88Compare4b2370c to
dd903bfComparedd903bf to
d2c573aCompareprincejwesley
commented
Nov 7, 2016
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
429e046Comparebenjamingr
commented
Nov 7, 2016
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. |
princejwesley
commented
Nov 7, 2016
@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 |
princejwesley
commented
Nov 12, 2016
@addaleax@Fishrock123@thefourtheye Have a look! |
princejwesley
commented
Nov 14, 2016
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
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~~~