diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index e395ee85e0852e..e0f51cbf589699 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -394,9 +394,9 @@ void UDPWrap::OnRecv(uv_udp_t* handle, Local UDPWrap::Instantiate(Environment* env, AsyncWrap* parent) { + EscapableHandleScope scope(env->isolate()); // If this assert fires then Initialize hasn't been called yet. CHECK_EQ(env->udp_constructor_function().IsEmpty(), false); - EscapableHandleScope scope(env->isolate()); Local ptr = External::New(env->isolate(), parent); return scope.Escape(env->udp_constructor_function()->NewInstance(1, &ptr)); }