Skip to content

Commit b669bac

Browse files
committed
url: remove unused URL::toObject
1 parent 82ee782 commit b669bac

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

src/node_url.cc

-45
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;
@@ -1934,48 +1931,6 @@ URL URL::FromFilePath(const std::string& file_path) {
19341931
return url;
19351932
}
19361933

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

src/node_url.h

-2
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)