mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
50dd555910
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
29 lines
799 B
JavaScript
29 lines
799 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const domain = require('domain');
|
|
const EventEmitter = require('events');
|
|
|
|
const d = new domain.Domain();
|
|
let implicit;
|
|
|
|
d.on('error', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'foobar');
|
|
assert.strictEqual(err.domain, d);
|
|
assert.strictEqual(err.domainEmitter, implicit);
|
|
assert.strictEqual(err.domainBound, undefined);
|
|
assert.strictEqual(err.domainThrown, false);
|
|
}));
|
|
|
|
// Implicit addition of the EventEmitter by being created within a domain-bound
|
|
// context.
|
|
d.run(common.mustCall(() => {
|
|
implicit = new EventEmitter();
|
|
}));
|
|
|
|
setTimeout(common.mustCall(() => {
|
|
// Escape from the domain, but implicit is still bound to it.
|
|
implicit.emit('error', new Error('foobar'));
|
|
}), 1);
|