From 20de5f3fa2c96897ae92ac27a1883b5d266d6ca1 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 7 Oct 2018 10:07:25 -0400 Subject: [PATCH] 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)));