-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #47039 Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
- Loading branch information
1 parent
be34777
commit 061fb20
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('node:assert'); | ||
const { getMaxListeners, EventEmitter, defaultMaxListeners, setMaxListeners } = require('node:events'); | ||
|
||
{ | ||
const ee = new EventEmitter(); | ||
assert.strictEqual(getMaxListeners(ee), defaultMaxListeners); | ||
setMaxListeners(101, ee); | ||
assert.strictEqual(getMaxListeners(ee), 101); | ||
} | ||
|
||
{ | ||
const et = new EventTarget(); | ||
assert.strictEqual(getMaxListeners(et), defaultMaxListeners); | ||
setMaxListeners(101, et); | ||
assert.strictEqual(getMaxListeners(et), 101); | ||
} |