File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2916,6 +2916,9 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
29162916
29172917 for (int i = 0 ; i < legacy_main_extensions_with_main_end; i++) {
29182918 file_path = *initial_file_path + std::string (legacy_main_extensions[i]);
2919+ #ifdef _WIN32
2920+ file_path = " \\\\ ?\\ " + file_path;
2921+ #endif
29192922
29202923 switch (FilePathIsFile (env, file_path)) {
29212924 case BindingData::FilePathIsFileReturnType::kIsFile :
@@ -2953,6 +2956,9 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
29532956 i < legacy_main_extensions_package_fallback_end;
29542957 i++) {
29552958 file_path = *initial_file_path + std::string (legacy_main_extensions[i]);
2959+ #ifdef _WIN32
2960+ file_path = " \\\\ ?\\ " + file_path;
2961+ #endif
29562962
29572963 switch (FilePathIsFile (env, file_path)) {
29582964 case BindingData::FilePathIsFileReturnType::kIsFile :
Original file line number Diff line number Diff line change @@ -256,8 +256,13 @@ void BindingData::ReadPackageJSON(const FunctionCallbackInfo<Value>& args) {
256256 permission::PermissionScope::kFileSystemRead ,
257257 path.ToStringView ());
258258
259+ #ifdef _WIN32
260+ auto package_json = GetPackageJSON (
261+ realm, " \\\\ ?\\ " + path.ToString (), is_esm ? &error_context : nullptr );
262+ #else
259263 auto package_json =
260264 GetPackageJSON (realm, path.ToString (), is_esm ? &error_context : nullptr );
265+ #endif
261266 if (package_json == nullptr ) {
262267 return ;
263268 }
You can’t perform that action at this time.
0 commit comments