Skip to content

Commit 548cbf0

Browse files
aduh95Flarna
authored andcommitted
perf_hooks: fix loop delay resolution validation
Fixes: #38160 PR-URL: #38166 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 993a1da commit 548cbf0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: src/node_perf.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void LoopIdleTime(const FunctionCallbackInfo<Value>& args) {
237237
void ELDHistogram::New(const FunctionCallbackInfo<Value>& args) {
238238
Environment* env = Environment::GetCurrent(args);
239239
CHECK(args.IsConstructCall());
240-
int32_t resolution = args[0].As<Int32>()->Value();
240+
int64_t resolution = args[0].As<Integer>()->Value();
241241
CHECK_GT(resolution, 0);
242242
new ELDHistogram(env, args.This(), resolution);
243243
}
@@ -253,7 +253,7 @@ void ELDHistogram::Initialize(Environment* env, Local<Object> target) {
253253
ELDHistogram::ELDHistogram(
254254
Environment* env,
255255
Local<Object> wrap,
256-
int32_t interval)
256+
int64_t interval)
257257
: IntervalHistogram(
258258
env,
259259
wrap,

Diff for: src/node_perf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class ELDHistogram : public IntervalHistogram {
166166
ELDHistogram(
167167
Environment* env,
168168
v8::Local<v8::Object> wrap,
169-
int32_t interval);
169+
int64_t interval);
170170

171171
void OnInterval() override;
172172

Diff for: test/sequential/test-performance-eventloopdelay.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const { sleep } = require('internal/util');
3939
);
4040
});
4141

42-
[-1, 0, Infinity].forEach((i) => {
42+
[-1, 0, 2 ** 53, Infinity].forEach((i) => {
4343
assert.throws(
4444
() => monitorEventLoopDelay({ resolution: i }),
4545
{

0 commit comments

Comments
 (0)