-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: rewrite BindingData::GetPackageScopeConfig, don't use url parser #54316
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this. Some small changes are required but in overall, I think this is the correct path forward
// BufferValue path_buffer(realm->isolate(), current_path_opt.value()); | ||
// // Check if the path has a trailing slash. If so, add it after | ||
// // ToNamespacedPath() as it will be deleted by ToNamespacedPath() | ||
// bool endsWithSlash = path_buffer.ToStringView().ends_with( | ||
// std::filesystem::path::preferred_separator); | ||
// ToNamespacedPath(realm->env(), &path_buffer); | ||
// std::string path_value_str = path_buffer.ToString(); | ||
// if (endsWithSlash) { | ||
// path_value_str.push_back(std::filesystem::path::preferred_separator); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand the purpose of this comments. Did you forget them?
// BufferValue path_buffer(realm->isolate(), current_path_opt.value()); | |
// // Check if the path has a trailing slash. If so, add it after | |
// // ToNamespacedPath() as it will be deleted by ToNamespacedPath() | |
// bool endsWithSlash = path_buffer.ToStringView().ends_with( | |
// std::filesystem::path::preferred_separator); | |
// ToNamespacedPath(realm->env(), &path_buffer); | |
// std::string path_value_str = path_buffer.ToString(); | |
// if (endsWithSlash) { | |
// path_value_str.push_back(std::filesystem::path::preferred_separator); | |
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToNamespacedPath needs to be called here, as current_path_opt is the non-UNC path and won't work if it's longer than 260 characters, but that function requires a BufferValue which requires a v8 value
I was planning to change ToNamespacedPath to accept a string, as it suggests here
Authored-By: Yagiz Nizipli <[email protected]> Co-authored-by: Yagiz Nizipli <[email protected]>
Will fix #54304 when completed
Rewrote BindingData::GetPackageScopeConfig to use std::filesystem::path instead of URL parser
TODO: