| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a24bd27 commit 7f0999c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,6 +232,15 @@ undefined | |||
| 232 | 232 | undefined | |
| 233 | 233 | ``` | |
| 234 | 234 | ||
| 235 | + ### Error handling | ||
| 236 | + | ||
| 237 | + By default, uncaught exceptions in the REPL are printed to the output stream | ||
| 238 | + (as with `Uncaught Error: REPL await` above). `uncaughtException` listeners | ||
| 239 | + can be added freely in both standalone and nested REPLs. The `handleError` | ||
| 240 | + option of [`repl.start()`][] can customize this behavior, including | ||
| 241 | + forwarding exceptions to [`'uncaughtException'`][] by returning | ||
| 242 | + `'unhandled'`. | ||
| 243 | + | ||
| 235 | 244 | ### Reverse-i-search | |
| 236 | 245 | ||
| 237 | 246 | <!-- YAML | |
@@ -425,6 +434,9 @@ const firstInstance = repl.start(options); | |||
| 425 | 434 | const secondInstance = new repl.REPLServer(options); | |
| 426 | 435 | ``` | |
| 427 | 436 | ||
| 437 | + Calling `repl.REPLServer()` without the `new` keyword throws a `TypeError` | ||
| 438 | + (see [DEP0185][]). | ||
| 439 | + | ||
| 428 | 440 | ### Event: `'exit'` | |
| 429 | 441 | ||
| 430 | 442 | <!-- YAML | |
@@ -1127,6 +1139,7 @@ avoiding open network interfaces. | |||
| 1127 | 1139 | ||
| 1128 | 1140 | Original code from <https://gist.github.com/TooTallNate/2053342>. | |
| 1129 | 1141 | ||
| 1142 | + [DEP0185]: deprecations.md#dep0185-instantiating-noderepl-classes-without-new | ||
| 1130 | 1143 | [TTY keybindings]: readline.md#tty-keybindings | |
| 1131 | 1144 | [ZSH]: https://en.wikipedia.org/wiki/Z_shell | |
| 1132 | 1145 | [`'uncaughtException'`]: process.md#event-uncaughtexception | |
| Back | FazBrowse Home | New Git URL |
0 commit comments