1
0
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:
Kris Maglione
2009-10-31 17:40:16 -04:00
parent d880d4afcb
commit 7a9889b18c
9 changed files with 244 additions and 232 deletions

View File

@@ -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) {}