summaryrefslogtreecommitdiff
path: root/src/udp_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/udp_wrap.cc')
-rw-r--r--src/udp_wrap.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index 8005eeb9ff..510926abde 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -138,8 +138,9 @@ void UDPWrap::Initialize(Local<Object> target,
AsyncWrap::AddWrapMethods(env, t);
HandleWrap::AddWrapMethods(env, t);
- target->Set(udpString, t->GetFunction());
- env->set_udp_constructor_function(t->GetFunction());
+ target->Set(udpString, t->GetFunction(env->context()).ToLocalChecked());
+ env->set_udp_constructor_function(
+ t->GetFunction(env->context()).ToLocalChecked());
// Create FunctionTemplate for SendWrap
Local<FunctionTemplate> swt =
@@ -148,7 +149,8 @@ void UDPWrap::Initialize(Local<Object> target,
Local<String> sendWrapString =
FIXED_ONE_BYTE_STRING(env->isolate(), "SendWrap");
swt->SetClassName(sendWrapString);
- target->Set(sendWrapString, swt->GetFunction());
+ target->Set(sendWrapString,
+ swt->GetFunction(env->context()).ToLocalChecked());
}