mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 08:56:32 +00:00

PR-URL: https://github.com/nodejs/node/pull/12992 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Luca Maraschi <luca.maraschi@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
23 lines
585 B
JavaScript
23 lines
585 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const domain = require('domain');
|
|
const assert = require('assert');
|
|
|
|
const d = domain.create();
|
|
|
|
process.on('uncaughtException', common.mustCall(function onUncaught() {
|
|
assert.strictEqual(
|
|
process.domain, null,
|
|
'domains stack should be empty in uncaughtException handler');
|
|
}));
|
|
|
|
process.on('beforeExit', common.mustCall(function onBeforeExit() {
|
|
assert.strictEqual(process.domain, null,
|
|
'domains stack should be empty in beforeExit handler');
|
|
}));
|
|
|
|
d.run(function() {
|
|
throw new Error('boom');
|
|
});
|