Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/io.js

Issue 10369004: File system path resolving (Closed)
Patch Set: Created April 24, 2013, 2:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // 1 //
2 // No direct file system access, using FileSystem API 2 // No direct file system access, using FileSystem API
3 // 3 //
4 4
5 var IO = exports.IO = 5 var IO = exports.IO =
6 { 6 {
7 lineBreak: "\n", 7 lineBreak: "\n",
8 8
9 resolveFilePath: function(path) 9 resolveFilePath: function(path)
10 { 10 {
11 return new FakeFile(path); 11 return new FakeFile(_fileSystem.resolve(path));
12 }, 12 },
13 13
14 readFromFile: function(file, decode, listener, callback, timeLineID) 14 readFromFile: function(file, decode, listener, callback, timeLineID)
15 { 15 {
16 if ("spec" in file && /^defaults\b/.test(file.spec)) 16 if ("spec" in file && /^defaults\b/.test(file.spec))
17 { 17 {
18 // Code attempts to read the default patterns.ini, we don't have that. 18 // Code attempts to read the default patterns.ini, we don't have that.
19 // Make sure to execute first-run actions instead. 19 // Make sure to execute first-run actions instead.
20 callback(null); 20 callback(null);
21 return; 21 return;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }, 72 },
73 73
74 statFile: function(file, callback) 74 statFile: function(file, callback)
75 { 75 {
76 _fileSystem.stat(file.path, function(result) 76 _fileSystem.stat(file.path, function(result)
77 { 77 {
78 callback(result.error, result); 78 callback(result.error, result);
79 }); 79 });
80 } 80 }
81 }; 81 };
OLDNEW

Powered by Google App Engine
This is Rietveld