Fixed typo and added more comments

This commit is contained in:
Bruno Chabrier 2016-05-13 18:12:58 +02:00
parent f6064db537
commit 2fdd378098

View File

@ -61,7 +61,11 @@ module.exports = function(grunt) {
var self = this;
var name = self.name || 'watch';
// keep track of previous watchers to delete them later
// As the context may have changed, it might be necessary
// to recreate the watchers. However, we do not delete
// the previous watchers immediately, or we take the
// risk to miss changes in the file system.
// Hence, keep track of previous watchers to delete them after
var previousWatchers = watchers;
watchers = [];
@ -185,7 +189,7 @@ module.exports = function(grunt) {
}));
});
// Close any previously opened watchers
prevousWatchers.forEach(function(watcher) {
previousWatchers.forEach(function(watcher) {
watcher.close();
});
});