node/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js
Vse Mozhet Byt 88d2e699d8
test: remove unneeded string splitting
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>
2017-05-15 13:49:45 +02:00

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');
});