blob: 69041c7523b1428b6cba762f789f9217eb223fac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
'use strict';
const common = require('../common');
const assert = require('assert');
const domain = require('domain').create();
const EventEmitter = require('events');
domain.on('error', common.mustNotCall());
const ee = new EventEmitter();
const plainObject = { justAn: 'object' };
ee.once('error', common.mustCall((err) => {
assert.deepStrictEqual(err, plainObject);
}));
ee.emit('error', plainObject);
const err = new Error('test error');
ee.once('error', common.expectsError(err));
ee.emit('error', err);
|