Skip to content

Commit e926354

Browse files
anonrigdanielleadams
authored andcommitted
url: replace url-parser with ada
PR-URL: #46410 Backport-PR-URL: #47435 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
1 parent 0bc4c17 commit e926354

17 files changed

+376
-2957
lines changed

lib/internal/url.js

+139-356
Large diffs are not rendered by default.

node.gyp

-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@
545545
'src/node_trace_events.cc',
546546
'src/node_types.cc',
547547
'src/node_url.cc',
548-
'src/node_url_tables.cc',
549548
'src/node_util.cc',
550549
'src/node_v8.cc',
551550
'src/node_wasi.cc',
@@ -1261,7 +1260,6 @@
12611260
'test/cctest/test_sockaddr.cc',
12621261
'test/cctest/test_traced_value.cc',
12631262
'test/cctest/test_util.cc',
1264-
'test/cctest/test_url.cc',
12651263
],
12661264

12671265
'conditions': [

src/crypto/crypto_common.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
#include "crypto/crypto_common.h"
12
#include "base_object-inl.h"
23
#include "env-inl.h"
4+
#include "memory_tracker-inl.h"
5+
#include "node.h"
36
#include "node_buffer.h"
47
#include "node_crypto.h"
5-
#include "crypto/crypto_common.h"
6-
#include "node.h"
78
#include "node_internals.h"
8-
#include "node_url.h"
99
#include "string_bytes.h"
10-
#include "memory_tracker-inl.h"
1110
#include "v8.h"
1211

1312
#include <openssl/ec.h>

src/inspector_agent.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,9 @@ class NodeInspectorClient : public V8InspectorClient {
647647
protocol::StringUtil::StringViewToUtf8(resource_name_view);
648648
if (!IsFilePath(resource_name))
649649
return nullptr;
650-
node::url::URL url = node::url::URL::FromFilePath(resource_name);
651-
return Utf8ToStringView(url.href());
650+
651+
std::string url = node::url::FromFilePath(resource_name);
652+
return Utf8ToStringView(url);
652653
}
653654

654655
node::Environment* env_;

src/module_wrap.cc

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "node_errors.h"
77
#include "node_internals.h"
88
#include "node_process-inl.h"
9-
#include "node_url.h"
109
#include "node_watchdog.h"
1110
#include "util-inl.h"
1211

@@ -20,8 +19,6 @@ namespace loader {
2019
using errors::TryCatchScope;
2120

2221
using node::contextify::ContextifyContext;
23-
using node::url::URL;
24-
using node::url::URL_FLAGS_FAILED;
2522
using v8::Array;
2623
using v8::ArrayBufferView;
2724
using v8::Context;

src/node_api.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
657657
// a file system path.
658658
// TODO(gabrielschulhof): Pass the `filename` through unchanged if/when we
659659
// receive it as a URL already.
660-
module_filename = node::url::URL::FromFilePath(filename.ToString()).href();
660+
module_filename = node::url::FromFilePath(filename.ToString());
661661
}
662662

663663
// Create a new napi_env for this specific module.

src/node_metadata.cc

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "node_metadata.h"
22
#include "acorn_version.h"
3+
#include "ada.h"
34
#include "ares.h"
45
#include "brotli/encode.h"
56
#include "llhttp.h"
@@ -115,6 +116,7 @@ Metadata::Versions::Versions() {
115116
#endif
116117

117118
simdutf = SIMDUTF_VERSION;
119+
ada = ADA_VERSION;
118120
}
119121

120122
Metadata::Release::Release() : name(NODE_RELEASE) {

src/node_metadata.h

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace node {
4747
V(uvwasi) \
4848
V(acorn) \
4949
V(simdutf) \
50+
V(ada) \
5051
NODE_VERSIONS_KEY_UNDICI(V)
5152

5253
#if HAVE_OPENSSL

0 commit comments

Comments
 (0)