Skip to content

events: refactor to use validator#45448

Closed
Lxxyx wants to merge 3 commits intonodejs:mainfrom
Lxxyx:refactor/events-use-validator
Closed

events: refactor to use validator#45448
Lxxyx wants to merge 3 commits intonodejs:mainfrom
Lxxyx:refactor/events-use-validator

Conversation

@Lxxyx
Copy link
Member

@Lxxyx Lxxyx commented Nov 13, 2022

Use validateNumber() for events(setMaxListeners/defaultMaxListeners).

If passed wrong parameter types, validateNumber() will throw ERR_INVALID_ARG_TYPE instead of original error code: ERR_OUT_OF_RANGE. I think ERR_INVALID_ARG_TYPE is more accurate.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants