Changeset 239427 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Dec 19, 2018, 8:41:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r239273 r239427 709 709 } 710 710 711 static std::optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile)711 static Optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile) 712 712 { 713 713 size_t firstSeparatorPosition = absolutePathToFile.find(pathSeparator()); 714 714 if (firstSeparatorPosition == notFound) 715 return std::nullopt;715 return WTF::nullopt; 716 716 DirectoryName directoryName; 717 717 directoryName.rootName = absolutePathToFile.substring(0, firstSeparatorPosition + 1); // Include the separator. … … 728 728 } 729 729 730 static std::optional<DirectoryName> currentWorkingDirectory()730 static Optional<DirectoryName> currentWorkingDirectory() 731 731 { 732 732 #if OS(WINDOWS) … … 742 742 DWORD bufferLength = ::GetCurrentDirectoryW(0, nullptr); 743 743 if (!bufferLength) 744 return std::nullopt;744 return WTF::nullopt; 745 745 // In Windows, wchar_t is the UTF-16LE. 746 746 // https://msdn.microsoft.com/en-us/library/dd374081.aspx … … 751 751 // We don't support network path like \\host\share\<path name>. 752 752 if (directoryString.startsWith("\\\\")) 753 return std::nullopt;753 return WTF::nullopt; 754 754 #else 755 755 Vector<char> buffer(PATH_MAX); 756 756 if (!getcwd(buffer.data(), PATH_MAX)) 757 return std::nullopt;757 return WTF::nullopt; 758 758 String directoryString = String::fromUTF8(buffer.data()); 759 759 #endif 760 760 if (directoryString.isEmpty()) 761 return std::nullopt;761 return WTF::nullopt; 762 762 763 763 if (directoryString[directoryString.length() - 1] == pathSeparator()) … … 2483 2483 auto scope = DECLARE_CATCH_SCOPE(vm); 2484 2484 2485 std::optional<DirectoryName> directoryName = currentWorkingDirectory();2485 Optional<DirectoryName> directoryName = currentWorkingDirectory(); 2486 2486 if (!directoryName) 2487 2487 return;
Note:
See TracChangeset
for help on using the changeset viewer.