| Index: lib/storage/io.js |
| =================================================================== |
| --- a/lib/storage/io.js |
| +++ b/lib/storage/io.js |
| @@ -111,16 +111,19 @@ var IO = exports.IO = |
| delete ext.storage[path]; |
| delete ext.storage[path + "/lastModified"]; |
| callback(null); |
| }, |
| statFile: function(file, callback) |
| { |
| var path = this._getFilePath(file); |
| - callback(null, { |
| + |
| + // This needs to use Utils.runAsync(), otherwise FilterStorage might |
| + // initialize too early - see #337. |
| + require("utils").Utils.runAsync(callback.bind(null, null, { |
| exists: path in ext.storage, |
| isDirectory: false, |
| isFile: true, |
| lastModified: parseInt(ext.storage[path + "/lastModified"], 10) || 0 |
| - }); |
| + })); |
| } |
| }; |