2017-11-20 19:57:20 +01:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
2019-12-25 18:02:16 +01:00
|
|
|
const assert = require('assert');
|
2017-11-20 19:57:20 +01:00
|
|
|
|
|
|
|
process.setUncaughtExceptionCaptureCallback(common.mustNotCall());
|
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
assert.throws(
|
2017-11-20 19:57:20 +01:00
|
|
|
() => require('domain'),
|
|
|
|
{
|
|
|
|
code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE',
|
2019-12-25 18:02:16 +01:00
|
|
|
name: 'Error',
|
2017-11-20 19:57:20 +01:00
|
|
|
message: /^A callback was registered.*with using the `domain` module/
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
process.setUncaughtExceptionCaptureCallback(null);
|
2018-02-10 02:33:08 +01:00
|
|
|
require('domain'); // Should not throw.
|