src: fix ToObject() usage in node_crypto.cc

PR-URL: https://github.com/nodejs/node/pull/23298
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig authored and Michaël Zasso committed 2018-10-10 04:15:57 +02:00
1 parent b2d3445644
commit 315bf257e5
1 file changed
+2 -1
+2 -1
View File
@@ -2164,7 +2164,8 @@ void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<String> reason_string = OneByteString(isolate, reason);
Local<Value> exception_value = Exception::Error(reason_string);
Local<Object> exception_object = exception_value->ToObject(isolate);
Local<Object> exception_object =
exception_value->ToObject(isolate->GetCurrentContext()).ToLocalChecked();
exception_object->Set(w->env()->context(), w->env()->code_string(),
OneByteString(isolate, code)).FromJust();
args.GetReturnValue().Set(exception_object);