From 28fe1ef63512acd40cfd1dd15918db494c92f45f Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 15 Dec 2020 11:52:17 -0800 Subject: src: reduce duplicated boilerplate with new env utility fn Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36536 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Joyee Cheung --- src/node_perf.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/node_perf.cc') diff --git a/src/node_perf.cc b/src/node_perf.cc index 1eddb00f48a..4d977d4ba61 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -705,8 +705,7 @@ void Initialize(Local target, env->SetProtoMethod(eldh, "enable", ELDHistogramEnable); env->SetProtoMethod(eldh, "disable", ELDHistogramDisable); env->SetProtoMethod(eldh, "reset", ELDHistogramReset); - target->Set(context, eldh_classname, - eldh->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, eldh_classname, eldh); } } // namespace performance -- cgit v1.2.3