mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
543 B
21 lines
543 B
'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);
|
|
}));
|
|
|
|
d.run(common.mustCall(() => {
|
|
setTimeout(common.mustCall(() => {
|
|
throw new Error('foobar');
|
|
}), 1);
|
|
}));
|
|
|