@@ -842,19 +842,6 @@ void AfterOpenFileHandle(uv_fs_t* req) {
842842 }
843843}
844844
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-
858845void AfterMkdirp (uv_fs_t * req) {
859846 FSReqBase* req_wrap = FSReqBase::from_req (req);
860847 FSReqAfterScope after (req_wrap, req);
@@ -864,7 +851,7 @@ void AfterMkdirp(uv_fs_t* req) {
864851 std::string first_path (req_wrap->continuation_data ()->first_path ());
865852 if (first_path.empty ())
866853 return req_wrap->Resolve (Undefined (req_wrap->env ()->isolate ()));
867- FromNamespacedPath (&first_path);
854+ node::url:: FromNamespacedPath (&first_path);
868855 Local<Value> path;
869856 Local<Value> error;
870857 if (!StringBytes::Encode (req_wrap->env ()->isolate (), first_path.c_str (),
@@ -1790,7 +1777,7 @@ static void MKDir(const FunctionCallbackInfo<Value>& args) {
17901777 if (!req_wrap_sync.continuation_data ()->first_path ().empty ()) {
17911778 Local<Value> error;
17921779 std::string first_path (req_wrap_sync.continuation_data ()->first_path ());
1793- FromNamespacedPath (&first_path);
1780+ node::url:: FromNamespacedPath (&first_path);
17941781 MaybeLocal<Value> path = StringBytes::Encode (env->isolate (),
17951782 first_path.c_str (),
17961783 UTF8, &error);
@@ -2900,7 +2887,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
29002887 return ;
29012888 }
29022889
2903- FromNamespacedPath (&initial_file_path.value ());
2890+ node::url:: FromNamespacedPath (&initial_file_path.value ());
29042891
29052892 for (int i = 0 ; i < legacy_main_extensions_with_main_end; i++) {
29062893 file_path = *initial_file_path + std::string (legacy_main_extensions[i]);
@@ -2935,7 +2922,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
29352922 return ;
29362923 }
29372924
2938- FromNamespacedPath (&initial_file_path.value ());
2925+ node::url:: FromNamespacedPath (&initial_file_path.value ());
29392926
29402927 for (int i = legacy_main_extensions_with_main_end;
29412928 i < legacy_main_extensions_package_fallback_end;
0 commit comments