summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-12-24 11:03:11 -0500
committercjihrig <cjihrig@gmail.com>2018-12-26 11:07:57 -0500
commit09519953ea1285e4d756e2dcdadaa77d6bc03245 (patch)
treeceb301e332f0974498635eff5d030c3a51b85b8a
parentb4145b89593a24006c8b4223b7aa40c18b2b588b (diff)
downloadandroid-node-v8-09519953ea1285e4d756e2dcdadaa77d6bc03245.tar.gz
android-node-v8-09519953ea1285e4d756e2dcdadaa77d6bc03245.tar.bz2
android-node-v8-09519953ea1285e4d756e2dcdadaa77d6bc03245.zip
src: fix compiler warnings in node_crypto.cc
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 <tniessen@tnie.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
-rw-r--r--src/node_crypto.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 3dff06f671..c2faad0a59 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -3339,10 +3339,12 @@ Local<Function> KeyObject::Initialize(Environment* env, Local<Object> 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<Object> KeyObject::Create(Environment* env,