Skip to content

Commit

Permalink
report time info for directories correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Dec 6, 2021
1 parent b903dd3 commit b1bcb18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/DirectoryWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,9 @@ class DirectoryWatcher extends EventEmitter {
} else {
for (const dir of this.directories.keys()) {
// No additional info about this directory
directoryTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY);
// but maybe another DirectoryWatcher has info
if (!directoryTimestamps.has(dir))
directoryTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY);
}
fileTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY);
directoryTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY);
Expand Down
2 changes: 0 additions & 2 deletions lib/watchpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const cachedNormalizeOptions = options => {

class WatchpackFileWatcher {
constructor(watchpack, watcher, files) {
if (!watcher) throw new Error();
this.files = Array.isArray(files) ? files : [files];
this.watcher = watcher;
watcher.on("initial-missing", type => {
Expand Down Expand Up @@ -106,7 +105,6 @@ class WatchpackFileWatcher {

class WatchpackDirectoryWatcher {
constructor(watchpack, watcher, directories) {
if (!watcher) throw new Error();
this.directories = Array.isArray(directories) ? directories : [directories];
this.watcher = watcher;
watcher.on("initial-missing", type => {
Expand Down

0 comments on commit b1bcb18

Please sign in to comment.