Skip to content

Commit 0951995

Browse files
committed
src: fix compiler warnings in node_crypto.cc
During the time between nodejs#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: nodejs#25205 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent b4145b8 commit 0951995

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
@@ -3339,10 +3339,12 @@ Local<Function> KeyObject::Initialize(Environment* env, Local<Object> target) {
33393339
GetAsymmetricKeyType);
33403340
env->SetProtoMethod(t, "export", Export);
33413341

3342-
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"),
3343-
t->GetFunction(env->context()).ToLocalChecked());
3342+
auto function = t->GetFunction(env->context()).ToLocalChecked();
3343+
target->Set(env->context(),
3344+
FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"),
3345+
function).FromJust();
33443346

3345-
return t->GetFunction();
3347+
return function;
33463348
}
33473349

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

0 commit comments

Comments
 (0)