Commit 429e046
committed
repl: REPL enhancements
* 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
>
```1 parent 24c9e46 commit 429e046
File tree
31 files changed
+819
-657
lines changed- doc/api
- lib
- internal
- test
- known_issues
- parallel
- sequential
31 files changed
+819
-657
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
| 55 | + | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
| |||
174 | 170 | | |
175 | 171 | | |
176 | 172 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | 173 | | |
206 | 174 | | |
207 | 175 | | |
| |||
286 | 254 | | |
287 | 255 | | |
288 | 256 | | |
289 | | - | |
| 257 | + | |
290 | 258 | | |
291 | | - | |
| 259 | + | |
292 | 260 | | |
293 | | - | |
| 261 | + | |
294 | 262 | | |
295 | | - | |
| 263 | + | |
296 | 264 | | |
297 | | - | |
| 265 | + | |
298 | 266 | | |
299 | 267 | | |
300 | 268 | | |
| |||
408 | 376 | | |
409 | 377 | | |
410 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
411 | 391 | | |
412 | 392 | | |
413 | 393 | | |
| |||
419 | 399 | | |
420 | 400 | | |
421 | 401 | | |
422 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
423 | 407 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
427 | 411 | | |
428 | 412 | | |
429 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | | - | |
| 743 | + | |
| 744 | + | |
744 | 745 | | |
745 | 746 | | |
746 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
| 972 | + | |
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
| |||
0 commit comments