Skip to content

Commit

Permalink
perf_hooks: fix loop delay resolution validation
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Apr 9, 2021
1 parent 7df0fc5 commit bc262f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/internal/perf/event_loop_delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
} = internalBinding('performance');

const {
validateInteger,
validateInt32,
validateObject,
} = require('internal/validators');

Expand Down Expand Up @@ -47,7 +47,7 @@ function monitorEventLoopDelay(options = {}) {
validateObject(options, 'options');

const { resolution = 10 } = options;
validateInteger(resolution, 'options.resolution', 1);
validateInt32(resolution, 'options.resolution', 1);

return new ELDHistogram(new _ELDHistogram(resolution));
}
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-performance-eventloopdelay.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { sleep } = require('internal/util');
);
});

[-1, 0, Infinity].forEach((i) => {
[-1, 0, 2**31, Infinity].forEach((i) => {
assert.throws(
() => monitorEventLoopDelay({ resolution: i }),
{
Expand Down

0 comments on commit bc262f7

Please sign in to comment.