Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a24264e

Browse filesBrowse files
addaleaxevanlucas
authored andcommitted
src: fix v8 local handling in node_url.cc
Calling `.As<Object>()` on a non-object aborts in debug mode, but `node_url.cc` relied on it. Address that by using `Local<Value>` until it has been confirmed that the handle actually is an object. PR-URL: #11064 Reviewed-By: Michal Zasso <targos@protonmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 65691d6 commit a24264e
Copy full SHA for a24264e

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎src/node_url.cc‎

Copy file name to clipboardExpand all lines: src/node_url.cc
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ namespace url {
636636
const char* input,
637637
const size_t len,
638638
enum url_parse_state override,
639-
Local<Object> base_obj,
640-
Local<Object> context_obj,
639+
Local<Value> base_obj,
640+
Local<Value> context_obj,
641641
Local<Function> cb) {
642642
Isolate* isolate = env->isolate();
643643
Local<Context> context = env->context();
@@ -654,9 +654,9 @@ namespace url {
654654
struct url_data base;
655655
struct url_data url;
656656
if (context_obj->IsObject())
657-
HarvestContext(env, &url, context_obj);
657+
HarvestContext(env, &url, context_obj.As<Object>());
658658
if (has_base)
659-
HarvestBase(env, &base, base_obj);
659+
HarvestBase(env, &base, base_obj.As<Object>());
660660

661661
std::string buffer;
662662
url.scheme.reserve(len);
@@ -1321,8 +1321,8 @@ namespace url {
13211321
Parse(env, args.This(),
13221322
*input, input.length(),
13231323
override,
1324-
args[2].As<Object>(),
1325-
args[3].As<Object>(),
1324+
args[2],
1325+
args[3],
13261326
args[4].As<Function>());
13271327
}
13281328

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.