@@ -842,19 +842,6 @@ void AfterOpenFileHandle(uv_fs_t* req) {
842
842
}
843
843
}
844
844
845
- // Reverse the logic applied by path.toNamespacedPath() to create a
846
- // namespace-prefixed path.
847
- void FromNamespacedPath (std::string* path) {
848
- #ifdef _WIN32
849
- if (path->compare (0 , 8 , " \\\\ ?\\ UNC\\ " , 8 ) == 0 ) {
850
- *path = path->substr (8 );
851
- path->insert (0 , " \\\\ " );
852
- } else if (path->compare (0 , 4 , " \\\\ ?\\ " , 4 ) == 0 ) {
853
- *path = path->substr (4 );
854
- }
855
- #endif
856
- }
857
-
858
845
void AfterMkdirp (uv_fs_t * req) {
859
846
FSReqBase* req_wrap = FSReqBase::from_req (req);
860
847
FSReqAfterScope after (req_wrap, req);
@@ -864,7 +851,7 @@ void AfterMkdirp(uv_fs_t* req) {
864
851
std::string first_path (req_wrap->continuation_data ()->first_path ());
865
852
if (first_path.empty ())
866
853
return req_wrap->Resolve (Undefined (req_wrap->env ()->isolate ()));
867
- FromNamespacedPath (&first_path);
854
+ node::url:: FromNamespacedPath (&first_path);
868
855
Local<Value> path;
869
856
Local<Value> error;
870
857
if (!StringBytes::Encode (req_wrap->env ()->isolate (), first_path.c_str (),
@@ -1813,7 +1800,7 @@ static void MKDir(const FunctionCallbackInfo<Value>& args) {
1813
1800
!req_wrap_sync.continuation_data ()->first_path ().empty ()) {
1814
1801
Local<Value> error;
1815
1802
std::string first_path (req_wrap_sync.continuation_data ()->first_path ());
1816
- FromNamespacedPath (&first_path);
1803
+ node::url:: FromNamespacedPath (&first_path);
1817
1804
MaybeLocal<Value> path = StringBytes::Encode (env->isolate (),
1818
1805
first_path.c_str (),
1819
1806
UTF8, &error);
@@ -2915,8 +2902,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
2915
2902
std::string file_path;
2916
2903
2917
2904
if (args.Length () >= 2 && args[1 ]->IsString ()) {
2918
- auto package_config_main =
2919
- Utf8Value (isolate, args[1 ]).ToString ();
2905
+ auto package_config_main = Utf8Value (isolate, args[1 ]).ToString ();
2920
2906
2921
2907
file_path_url = ada::parse<ada::url_aggregator>(
2922
2908
std::string (" ./" ) + package_config_main, &package_json_url.value ());
@@ -2931,7 +2917,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
2931
2917
return ;
2932
2918
}
2933
2919
2934
- FromNamespacedPath (&initial_file_path.value ());
2920
+ node::url:: FromNamespacedPath (&initial_file_path.value ());
2935
2921
2936
2922
for (int i = 0 ; i < legacy_main_extensions_with_main_end; i++) {
2937
2923
file_path = *initial_file_path + std::string (legacy_main_extensions[i]);
@@ -2966,7 +2952,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
2966
2952
return ;
2967
2953
}
2968
2954
2969
- FromNamespacedPath (&initial_file_path.value ());
2955
+ node::url:: FromNamespacedPath (&initial_file_path.value ());
2970
2956
2971
2957
for (int i = legacy_main_extensions_with_main_end;
2972
2958
i < legacy_main_extensions_package_fallback_end;
0 commit comments