reapply 834417f734 which was accidentally reverted

c9
nightwing 2015-02-27 18:43:20 +04:00
rodzic 59bfa6e1ea
commit a51f96a157
1 zmienionych plików z 9 dodań i 11 usunięć

18
node_modules/vfs-local/localfs.js wygenerowano vendored
Wyświetl plik

@ -1380,21 +1380,19 @@ module.exports = function setup(fsOptions) {
}); });
callback(done); callback(done);
function loop(watchers, path, event, callback) { function done(callback) {
if (!watchers.length) if (!watchers.length)
return callback(); return callback();
// Notify each watcher of changes and reactivate it
var watcher = watchers.pop(); var watcher = watchers.pop();
watcher.handleWatchEvent(event, basename(path), true); fs.stat(path, function(err, stat) {
if (err || !stat) return;
watcher.resume(function() { stat.vfsWrite = true;
loop(watchers, path, event, callback); watcher.sendToAllListeners("change", basename(path), stat);
}); });
} watcher.resume(function() {
done(callback);
function done(callback) {
loop(watchers, path, "change", function() {
loop(dirWatchers, parentDir, "directory", callback);
}); });
} }
} }