From 665129998c0155dcccfa5a57ae877ba4f4b44aa5 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sat, 30 Jan 2021 07:17:59 -0800 Subject: [PATCH] fixup! fixup! perf_hooks: complete overhaul of the implementation --- lib/internal/perf/event_loop_delay.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/perf/event_loop_delay.js b/lib/internal/perf/event_loop_delay.js index dddc3e5393af1f0..cccaca4ff7c4106 100644 --- a/lib/internal/perf/event_loop_delay.js +++ b/lib/internal/perf/event_loop_delay.js @@ -9,6 +9,7 @@ const { } = internalBinding('performance'); const { + validateInteger, validateNumber, validateObject, } = require('internal/validators'); @@ -34,9 +35,7 @@ function monitorEventLoopDelay(options = {}) { validateObject(options, 'options'); const { resolution = 10 } = options; - validateNumber(resolution, 'options.resolution'); - if (resolution <= 0 || !NumberIsSafeInteger(resolution)) - throw new ERR_INVALID_ARG_VALUE.RangeError('resolution', resolution); + validateInteger(resolution, 'options.resolution', 1); return new ELDHistogram(new _ELDHistogram(resolution)); }