From 7dde560beb736e82b7867130a2d5824544122a60 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Fri, 21 Sep 2018 13:13:35 +0200 Subject: src: replace deprecated uses of FunctionTemplate::GetFunction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/22993 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Ujjwal Sharma Reviewed-By: Joyee Cheung Reviewed-By: Eugene Ostroukhov Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/tcp_wrap.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tcp_wrap.cc') diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index d8080319aa..554b0216fa 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -60,7 +60,9 @@ Local TCPWrap::Instantiate(Environment* env, EscapableHandleScope handle_scope(env->isolate()); AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(parent); CHECK_EQ(env->tcp_constructor_template().IsEmpty(), false); - Local constructor = env->tcp_constructor_template()->GetFunction(); + Local constructor = env->tcp_constructor_template() + ->GetFunction(env->context()) + .ToLocalChecked(); CHECK_EQ(constructor.IsEmpty(), false); Local type_value = Int32::New(env->isolate(), type); Local instance = @@ -107,7 +109,7 @@ void TCPWrap::Initialize(Local target, env->SetProtoMethod(t, "setSimultaneousAccepts", SetSimultaneousAccepts); #endif - target->Set(tcpString, t->GetFunction()); + target->Set(tcpString, t->GetFunction(env->context()).ToLocalChecked()); env->set_tcp_constructor_template(t); // Create FunctionTemplate for TCPConnectWrap. @@ -117,7 +119,7 @@ void TCPWrap::Initialize(Local target, Local wrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "TCPConnectWrap"); cwt->SetClassName(wrapString); - target->Set(wrapString, cwt->GetFunction()); + target->Set(wrapString, cwt->GetFunction(env->context()).ToLocalChecked()); // Define constants Local constants = Object::New(env->isolate()); -- cgit v1.2.3