diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-11-20 19:57:20 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-11-29 15:58:42 +0100 |
commit | 4503da8a3a3b0b71d950a63de729ce495965f6ea (patch) | |
tree | 66ad243cd90cea3df8fc11eb7cf29597ddd56eb3 /test/parallel/test-domain-load-after-set-uncaught-exception-capture.js | |
parent | 04e3aa28bbcdf62f677dd314ad8c12556c18c15f (diff) | |
download | android-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.tar.gz android-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.tar.bz2 android-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.zip |
process: add flag for uncaught exception abort
Introduce `process.shouldAbortOnUncaughtException` to control
`--abort-on-uncaught-exception` behaviour, and implement
some of the domains functionality on top of it.
PR-URL: https://github.com/nodejs/node/pull/17159
Refs: https://github.com/nodejs/node/issues/17143
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'test/parallel/test-domain-load-after-set-uncaught-exception-capture.js')
-rw-r--r-- | test/parallel/test-domain-load-after-set-uncaught-exception-capture.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js b/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js new file mode 100644 index 0000000000..9e438368d6 --- /dev/null +++ b/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js @@ -0,0 +1,18 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +process.setUncaughtExceptionCaptureCallback(common.mustNotCall()); + +common.expectsError( + () => require('domain'), + { + code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE', + type: Error, + message: /^A callback was registered.*with using the `domain` module/ + } +); + +process.setUncaughtExceptionCaptureCallback(null); + +assert.doesNotThrow(() => require('domain')); |