mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 09:48:00 +01:00
Add IO#File.
New review: owner: dougkearns I like this for the most part, except that it has to go to lengths to wrap the original nsIFile correctly, an that it can't be passed directly to other XPCOM components. It makes most operations on files a lot cleaner, though.
This commit is contained in:
@@ -688,9 +688,9 @@ const util = { //{{{
|
||||
try
|
||||
{
|
||||
// Try to find a matching file.
|
||||
let file = io.getFile(url);
|
||||
let file = io.File(url);
|
||||
if (file.exists() && file.isReadable())
|
||||
return services.get("io").newFileURI(file).spec;
|
||||
return services.get("io").newFileURI(file.wrappedNative).spec;
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user