summaryrefslogtreecommitdiff
path: root/src/node_http_parser.cc
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-10-07 10:07:25 -0400
committercjihrig <cjihrig@gmail.com>2018-10-10 10:32:05 -0400
commit20de5f3fa2c96897ae92ac27a1883b5d266d6ca1 (patch)
tree37c81411b59ed93df1747a53e93f2db319e4cc7e /src/node_http_parser.cc
parent59d2bd9fb5da1606ce673246aa5ca9fe17c7dd53 (diff)
downloadnode-new-20de5f3fa2c96897ae92ac27a1883b5d266d6ca1.tar.gz
src: fix ToObject() usage in node_http_parser.cc
PR-URL: https://github.com/nodejs/node/pull/23314 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'src/node_http_parser.cc')
-rw-r--r--src/node_http_parser.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index 9850b4f698..b82710480d 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<Value> e = Exception::Error(env()->parse_error_string());
- Local<Object> obj = e->ToObject(env()->isolate());
+ Local<Object> 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)));