diff --git a/src/exceptions.cc b/src/exceptions.cc index c9e308240fe771..98c87603dd9be3 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -128,7 +128,9 @@ Local UVException(Isolate* isolate, String::Concat(isolate, js_msg, FIXED_ONE_BYTE_STRING(isolate, "'")); } - Local e = Exception::Error(js_msg)->ToObject(isolate); + Local e = + Exception::Error(js_msg)->ToObject(isolate->GetCurrentContext()) + .ToLocalChecked(); e->Set(env->errno_string(), Integer::New(isolate, errorno)); e->Set(env->code_string(), js_code); diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 9850b4f698205b..b82710480de4bc 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -623,7 +623,8 @@ class Parser : public AsyncWrap, public StreamListener { enum http_errno err = HTTP_PARSER_ERRNO(&parser_); Local e = Exception::Error(env()->parse_error_string()); - Local obj = e->ToObject(env()->isolate()); + Local obj = e->ToObject(env()->isolate()->GetCurrentContext()) + .ToLocalChecked(); obj->Set(env()->bytes_parsed_string(), nparsed_obj); obj->Set(env()->code_string(), OneByteString(env()->isolate(), http_errno_name(err)));