• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3require('../common');
4const assert = require('node:assert');
5const { getMaxListeners, EventEmitter, defaultMaxListeners, setMaxListeners } = require('node:events');
6
7{
8  const ee = new EventEmitter();
9  assert.strictEqual(getMaxListeners(ee), defaultMaxListeners);
10  setMaxListeners(101, ee);
11  assert.strictEqual(getMaxListeners(ee), 101);
12}
13
14{
15  const et = new EventTarget();
16  assert.strictEqual(getMaxListeners(et), defaultMaxListeners);
17  setMaxListeners(101, et);
18  assert.strictEqual(getMaxListeners(et), 101);
19}
20