From 59d2bd9fb5da1606ce673246aa5ca9fe17c7dd53 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 7 Oct 2018 10:05:30 -0400 Subject: [PATCH 1/2] src: fix ToObject() usage in exceptions.cc PR-URL: https://github.com/nodejs/node/pull/23314 Reviewed-By: Anna Henningsen Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani --- src/exceptions.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); From 20de5f3fa2c96897ae92ac27a1883b5d266d6ca1 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 7 Oct 2018 10:07:25 -0400 Subject: [PATCH 2/2] src: fix ToObject() usage in node_http_parser.cc PR-URL: https://github.com/nodejs/node/pull/23314 Reviewed-By: Anna Henningsen Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani --- src/node_http_parser.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)));