From c02f8ec09cdb65cddf0d3a5bed29578741b5084d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 28 Jan 2017 21:18:55 -0800 Subject: [PATCH] src: fix v8 local handling in node_url.cc Calling `.As()` on a non-object aborts in debug mode, but `node_url.cc` relied on it. Address that by using `Local` until it has been confirmed that the handle actually is an object. --- src/node_url.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index 92cb8efbb84389..7f21051c54e5ac 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -636,8 +636,8 @@ namespace url { const char* input, const size_t len, enum url_parse_state override, - Local base_obj, - Local context_obj, + Local base_obj, + Local context_obj, Local cb) { Isolate* isolate = env->isolate(); Local context = env->context(); @@ -654,9 +654,9 @@ namespace url { struct url_data base; struct url_data url; if (context_obj->IsObject()) - HarvestContext(env, &url, context_obj); + HarvestContext(env, &url, context_obj.As()); if (has_base) - HarvestBase(env, &base, base_obj); + HarvestBase(env, &base, base_obj.As()); std::string buffer; url.scheme.reserve(len); @@ -1321,8 +1321,8 @@ namespace url { Parse(env, args.This(), *input, input.length(), override, - args[2].As(), - args[3].As(), + args[2], + args[3], args[4].As()); }