diff --git a/src/node_perf.cc b/src/node_perf.cc index 908c76c2110d26..e16be29a872f80 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -333,10 +333,9 @@ inline Local GetName(Local fn) { // execution. void TimerFunctionCall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - Environment* env = Environment::GetCurrent(isolate); + Local context = isolate->GetCurrentContext(); + Environment* env = Environment::GetCurrent(context); CHECK_NOT_NULL(env); - Local context = env->context(); Local fn = args.Data().As(); size_t count = args.Length(); size_t idx;