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 9a604d6

Browse filesBrowse files
anonrigMylesBorins
authored andcommitted
url: remove unused URL::toObject
PR-URL: #46486 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d6fbebd commit 9a604d6
Copy full SHA for 9a604d6

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+0
-47
lines changed
Open diff view settings
Collapse file

‎src/node_url.cc‎

Copy file name to clipboardExpand all lines: src/node_url.cc
-45Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
namespace node {
1515

16-
using errors::TryCatchScope;
17-
1816
using url::table_data::hex;
1917
using url::table_data::C0_CONTROL_ENCODE_SET;
2018
using url::table_data::FRAGMENT_ENCODE_SET;
@@ -32,7 +30,6 @@ using v8::Int32;
3230
using v8::Integer;
3331
using v8::Isolate;
3432
using v8::Local;
35-
using v8::MaybeLocal;
3633
using v8::NewStringType;
3734
using v8::Null;
3835
using v8::Object;
@@ -1925,48 +1922,6 @@ URL URL::FromFilePath(const std::string& file_path) {
19251922
return url;
19261923
}
19271924

1928-
// This function works by calling out to a JS function that creates and
1929-
// returns the JS URL object. Be mindful of the JS<->Native boundary
1930-
// crossing that is required.
1931-
MaybeLocal<Value> URL::ToObject(Environment* env) const {
1932-
Isolate* isolate = env->isolate();
1933-
Local<Context> context = env->context();
1934-
Context::Scope context_scope(context);
1935-
1936-
const Local<Value> undef = Undefined(isolate);
1937-
const Local<Value> null = Null(isolate);
1938-
1939-
if (context_.flags & URL_FLAGS_FAILED)
1940-
return Local<Value>();
1941-
1942-
Local<Value> argv[] = {
1943-
undef,
1944-
undef,
1945-
undef,
1946-
undef,
1947-
null, // host defaults to null
1948-
null, // port defaults to null
1949-
undef,
1950-
null, // query defaults to null
1951-
null, // fragment defaults to null
1952-
};
1953-
SetArgs(env, argv, context_);
1954-
1955-
MaybeLocal<Value> ret;
1956-
{
1957-
TryCatchScope try_catch(env, TryCatchScope::CatchMode::kFatal);
1958-
1959-
// The SetURLConstructor method must have been called already to
1960-
// set the constructor function used below. SetURLConstructor is
1961-
// called automatically when the internal/url.js module is loaded
1962-
// during the internal/bootstrap/node.js processing.
1963-
ret = env->url_constructor_function()
1964-
->Call(env->context(), undef, arraysize(argv), argv);
1965-
}
1966-
1967-
return ret;
1968-
}
1969-
19701925
} // namespace url
19711926
} // namespace node
19721927

Collapse file

‎src/node_url.h‎

Copy file name to clipboardExpand all lines: src/node_url.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ class URL {
183183
// Get the file URL from native file system path.
184184
static URL FromFilePath(const std::string& file_path);
185185

186-
v8::MaybeLocal<v8::Value> ToObject(Environment* env) const;
187-
188186
URL(const URL&) = default;
189187
URL& operator=(const URL&) = default;
190188
URL(URL&&) = default;

0 commit comments

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