mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
18 lines
491 B
JavaScript
18 lines
491 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
const domain = require('domain');
|
||
|
|
||
|
const d = new domain.Domain();
|
||
|
|
||
|
d.on('error', common.mustCall((err) => {
|
||
|
assert.strictEqual(err.message, 'foobar');
|
||
|
assert.strictEqual(err.domain, d);
|
||
|
assert.strictEqual(err.domainEmitter, undefined);
|
||
|
assert.strictEqual(err.domainBound, undefined);
|
||
|
assert.strictEqual(err.domainThrown, true);
|
||
|
}));
|
||
|
|
||
|
setTimeout(d.bind(() => { throw new Error('foobar'); }), 1);
|