Skip to content
Browse files

doc: document using `domain` in REPL

Document that REPL uses the `domain` module to handle uncaught
exceptions, and the side effects caused by it.

PR-URL: #20382
Fixes: #19998
Reviewed-By: Vse Mozhet Byt <>
Reviewed-By: Anna Henningsen <>
Reviewed-By: Trivikram Kamat <>
Reviewed-By: Ruben Bridgewater <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: James M Snell <>
  • Loading branch information
AyushG3112 authored and vsemozhetbyt committed May 4, 2018
1 parent 2d609c5 commit 1cf7ef6433d773f15e324a9f284fe8b674d0d90c
Showing with 15 additions and 0 deletions.
  1. +15 −0 doc/api/
@@ -141,6 +141,17 @@ global or scoped variable, the input `fs` will be evaluated on-demand as
> fs.createReadStream('./some/file');

#### Global Uncaught Exceptions

The REPL uses the [`domain`][] module to catch all uncaught exceptions for that
REPL session.

This use of the [`domain`][] module in the REPL has these side effects:

* Uncaught exceptions do not emit the [`'uncaughtException'`][] event.
* Trying to use [`process.setUncaughtExceptionCaptureCallback()`][] throws

#### Assignment of the `_` (underscore) variable
<!-- YAML
@@ -613,7 +624,11 @@ a `net.Server` and `net.Socket` instance, see:
For an example of running a REPL instance over [curl(1)][], see:

[`'uncaughtException'`]: process.html#process_event_uncaughtexception
[`--experimental-repl-await`]: cli.html#cli_experimental_repl_await
[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.html#errors_err_domain_cannot_set_uncaught_exception_capture
[`domain`]: domain.html
[`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn
[`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function
[`readline.Interface`]: readline.html#readline_class_interface
[`util.inspect()`]: util.html#util_util_inspect_object_options

0 comments on commit 1cf7ef6

Please sign in to comment.