mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
perf_hooks: fix loop delay resolution validation
Fixes: https://github.com/nodejs/node/issues/38160 PR-URL: https://github.com/nodejs/node/pull/38166 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
993a1da47c
commit
548cbf0625
3 files changed
+4
-4
No files matched your search
+2
-2
@@ -237,7 +237,7 @@ void LoopIdleTime(const FunctionCallbackInfo<Value>& args) {
|
||||
void ELDHistogram::New(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
CHECK(args.IsConstructCall());
|
||||
int32_t resolution = args[0].As<Int32>()->Value();
|
||||
int64_t resolution = args[0].As<Integer>()->Value();
|
||||
CHECK_GT(resolution, 0);
|
||||
new ELDHistogram(env, args.This(), resolution);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void ELDHistogram::Initialize(Environment* env, Local<Object> target) {
|
||||
ELDHistogram::ELDHistogram(
|
||||
Environment* env,
|
||||
Local<Object> wrap,
|
||||
int32_t interval)
|
||||
int64_t interval)
|
||||
: IntervalHistogram(
|
||||
env,
|
||||
wrap,
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ class ELDHistogram : public IntervalHistogram {
|
||||
ELDHistogram(
|
||||
Environment* env,
|
||||
v8::Local<v8::Object> wrap,
|
||||
int32_t interval);
|
||||
int64_t interval);
|
||||
|
||||
void OnInterval() override;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const { sleep } = require('internal/util');
|
||||
);
|
||||
});
|
||||
|
||||
[-1, 0, Infinity].forEach((i) => {
|
||||
[-1, 0, 2 ** 53, Infinity].forEach((i) => {
|
||||
assert.throws(
|
||||
() => monitorEventLoopDelay({ resolution: i }),
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user