From 09519953ea1285e4d756e2dcdadaa77d6bc03245 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 24 Dec 2018 11:03:11 -0500 Subject: [PATCH] src: fix compiler warnings in node_crypto.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the time between https://github.com/nodejs/node/pull/24234 being opened and it landing, a V8 update occurred that deprecated several APIs. This commit fixes the following compiler warnings: ../src/node_crypto.cc:3342:11: warning: 'Set' is deprecated: Use maybe version ../src/node_crypto.cc:3345:13: warning: 'GetFunction' is deprecated: Use maybe version PR-URL: https://github.com/nodejs/node/pull/25205 Reviewed-By: Tobias Nießen Reviewed-By: Daniel Bevenius --- src/node_crypto.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 3dff06f671756c..c2faad0a5966bc 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3339,10 +3339,12 @@ Local KeyObject::Initialize(Environment* env, Local target) { GetAsymmetricKeyType); env->SetProtoMethod(t, "export", Export); - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"), - t->GetFunction(env->context()).ToLocalChecked()); + auto function = t->GetFunction(env->context()).ToLocalChecked(); + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"), + function).FromJust(); - return t->GetFunction(); + return function; } Local KeyObject::Create(Environment* env,