Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-27 21:59:29 +0300
committerMichaël Zasso <targos@protonmail.com>2019-11-30 15:45:38 +0300
commit1f9a5ae7aadd073ac61933226687a4483f8eccf4 (patch)
tree2d07023ce21a0aa0339344ea513bce8490c27757 /lib/events.js
parent7fc5980cfe79c9b7ff19837397823a583c9fd8fe (diff)
lib: use static Number properties from primordials
PR-URL: https://github.com/nodejs/node/pull/30686 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/events.js')
-rw-r--r--lib/events.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/events.js b/lib/events.js
index f8c268ee1cd..a09333af443 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -24,6 +24,7 @@
const {
Array,
MathMin,
+ NumberIsNaN,
ObjectCreate,
ObjectDefineProperty,
ObjectGetPrototypeOf,
@@ -79,7 +80,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
return defaultMaxListeners;
},
set: function(arg) {
- if (typeof arg !== 'number' || arg < 0 || Number.isNaN(arg)) {
+ if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new ERR_OUT_OF_RANGE('defaultMaxListeners',
'a non-negative number',
arg);
@@ -102,7 +103,7 @@ EventEmitter.init = function() {
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== 'number' || n < 0 || Number.isNaN(n)) {
+ if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new ERR_OUT_OF_RANGE('n', 'a non-negative number', n);
}
this._maxListeners = n;