Skip to content

Commit 73ccfc8

Browse files
cjihrigtargos
authored andcommitted
src: fix compiler warnings in node_crypto.cc
During the time between #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: #25205 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 7365b00 commit 73ccfc8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/node_crypto.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -3312,10 +3312,12 @@ Local<Function> KeyObject::Initialize(Environment* env, Local<Object> target) {
33123312
GetAsymmetricKeyType);
33133313
env->SetProtoMethod(t, "export", Export);
33143314

3315-
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"),
3316-
t->GetFunction(env->context()).ToLocalChecked());
3315+
auto function = t->GetFunction(env->context()).ToLocalChecked();
3316+
target->Set(env->context(),
3317+
FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"),
3318+
function).FromJust();
33173319

3318-
return t->GetFunction();
3320+
return function;
33193321
}
33203322

33213323
Local<Object> KeyObject::Create(Environment* env,

0 commit comments

Comments
 (0)