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 d6fbebd

Browse filesBrowse files
anonrigMylesBorins
authored andcommitted
url: remove unused setURLConstructor function
PR-URL: #46485 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 9d9b3f8 commit d6fbebd
Copy full SHA for d6fbebd

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

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

‎lib/internal/url.js‎

Copy file name to clipboardExpand all lines: lib/internal/url.js
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const {
9292
domainToUnicode: _domainToUnicode,
9393
encodeAuth,
9494
parse,
95-
setURLConstructor,
9695
URL_FLAGS_CANNOT_BE_BASE,
9796
URL_FLAGS_HAS_FRAGMENT,
9897
URL_FLAGS_HAS_HOST,
@@ -1572,29 +1571,6 @@ function toPathIfFileURL(fileURLOrPath) {
15721571
return fileURLToPath(fileURLOrPath);
15731572
}
15741573

1575-
function constructUrl(flags, protocol, username, password,
1576-
host, port, path, query, fragment) {
1577-
const ctx = new URLContext();
1578-
ctx.flags = flags;
1579-
ctx.scheme = protocol;
1580-
ctx.username = (flags & URL_FLAGS_HAS_USERNAME) !== 0 ? username : '';
1581-
ctx.password = (flags & URL_FLAGS_HAS_PASSWORD) !== 0 ? password : '';
1582-
ctx.port = port;
1583-
ctx.path = (flags & URL_FLAGS_HAS_PATH) !== 0 ? path : [];
1584-
ctx.query = query;
1585-
ctx.fragment = fragment;
1586-
ctx.host = host;
1587-
1588-
const url = { __proto__: URL.prototype };
1589-
url[context] = ctx;
1590-
const params = new URLSearchParams();
1591-
url[searchParams] = params;
1592-
params[context] = url;
1593-
initSearchParams(params, query);
1594-
return url;
1595-
}
1596-
setURLConstructor(constructUrl);
1597-
15981574
module.exports = {
15991575
toUSVString,
16001576
fileURLToPath,
Collapse file

‎src/node_url.cc‎

Copy file name to clipboardExpand all lines: src/node_url.cc
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,6 @@ void DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
18241824
String::NewFromUtf8(env->isolate(), out.c_str()).ToLocalChecked());
18251825
}
18261826

1827-
void SetURLConstructor(const FunctionCallbackInfo<Value>& args) {
1828-
Environment* env = Environment::GetCurrent(args);
1829-
CHECK_EQ(args.Length(), 1);
1830-
CHECK(args[0]->IsFunction());
1831-
env->set_url_constructor_function(args[0].As<Function>());
1832-
}
1833-
18341827
void Initialize(Local<Object> target,
18351828
Local<Value> unused,
18361829
Local<Context> context,
@@ -1839,7 +1832,6 @@ void Initialize(Local<Object> target,
18391832
SetMethodNoSideEffect(context, target, "encodeAuth", EncodeAuthSet);
18401833
SetMethodNoSideEffect(context, target, "domainToASCII", DomainToASCII);
18411834
SetMethodNoSideEffect(context, target, "domainToUnicode", DomainToUnicode);
1842-
SetMethod(context, target, "setURLConstructor", SetURLConstructor);
18431835

18441836
#define XX(name, _) NODE_DEFINE_CONSTANT(target, name);
18451837
FLAGS(XX)
@@ -1856,7 +1848,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
18561848
registry->Register(EncodeAuthSet);
18571849
registry->Register(DomainToASCII);
18581850
registry->Register(DomainToUnicode);
1859-
registry->Register(SetURLConstructor);
18601851
}
18611852

18621853
std::string URL::ToFilePath() const {

0 commit comments

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