Skip to content

Commit b1bcb18

Browse files
committed
report time info for directories correctly
1 parent b903dd3 commit b1bcb18

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/DirectoryWatcher.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,9 @@ class DirectoryWatcher extends EventEmitter {
726726
} else {
727727
for (const dir of this.directories.keys()) {
728728
// No additional info about this directory
729-
directoryTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY);
729+
// but maybe another DirectoryWatcher has info
730+
if (!directoryTimestamps.has(dir))
731+
directoryTimestamps.set(dir, EXISTANCE_ONLY_TIME_ENTRY);
730732
}
731733
fileTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY);
732734
directoryTimestamps.set(this.path, EXISTANCE_ONLY_TIME_ENTRY);

lib/watchpack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const cachedNormalizeOptions = options => {
6666

6767
class WatchpackFileWatcher {
6868
constructor(watchpack, watcher, files) {
69-
if (!watcher) throw new Error();
7069
this.files = Array.isArray(files) ? files : [files];
7170
this.watcher = watcher;
7271
watcher.on("initial-missing", type => {
@@ -106,7 +105,6 @@ class WatchpackFileWatcher {
106105

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

0 commit comments

Comments
 (0)