From 7451ffb04c0560cd60c29ac7084104f6829da880 Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Sun, 14 Nov 2021 22:23:14 +0000 Subject: [PATCH] Make backwards compatible --- lib/WatchIgnorePlugin.js | 2 +- lib/Watching.js | 2 +- lib/node/NodeWatchFileSystem.js | 4 ++-- lib/util/fs.js | 2 +- types.d.ts | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/WatchIgnorePlugin.js b/lib/WatchIgnorePlugin.js index 75809f0feed..4ee0f9e52da 100644 --- a/lib/WatchIgnorePlugin.js +++ b/lib/WatchIgnorePlugin.js @@ -50,7 +50,7 @@ class IgnoringWatchFileSystem { missing, startTime, options, - (err, fileTimestamps, changedFiles, removedFiles) => { + (err, fileTimestamps, _, changedFiles, removedFiles) => { if (err) return callback(err); for (const path of ignoredFiles) { fileTimestamps.set(path, IGNORE_TIME_ENTRY); diff --git a/lib/Watching.js b/lib/Watching.js index 956d0f1ea1d..12a6547b7b6 100644 --- a/lib/Watching.js +++ b/lib/Watching.js @@ -310,7 +310,7 @@ class Watching { missing, this.lastWatcherStartTime, this.watchOptions, - (err, fileTimeInfoEntries, changedFiles, removedFiles) => { + (err, fileTimeInfoEntries, _, changedFiles, removedFiles) => { if (err) { this.compiler.modifiedFiles = undefined; this.compiler.removedFiles = undefined; diff --git a/lib/node/NodeWatchFileSystem.js b/lib/node/NodeWatchFileSystem.js index 1e537ef36ba..67ef918b8a3 100644 --- a/lib/node/NodeWatchFileSystem.js +++ b/lib/node/NodeWatchFileSystem.js @@ -28,7 +28,7 @@ class NodeWatchFileSystem { * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object - * @param {function(Error=, Map, Set, Set): void} callback aggregated callback + * @param {function(Error=, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ @@ -79,7 +79,7 @@ class NodeWatchFileSystem { } } const times = this.watcher.getTimeInfoEntries(); - callback(null, times, changes, removals); + callback(null, times, times, changes, removals); }); this.watcher.watch({ files, directories, missing, startTime }); diff --git a/lib/util/fs.js b/lib/util/fs.js index 5ae3a0d181c..0efca048fda 100644 --- a/lib/util/fs.js +++ b/lib/util/fs.js @@ -78,7 +78,7 @@ const path = require("path"); * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object - * @param {function(Error=, Map, Set, Set): void} callback aggregated callback + * @param {function(Error=, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ diff --git a/types.d.ts b/types.d.ts index bc183be1e7a..218e4727a36 100644 --- a/types.d.ts +++ b/types.d.ts @@ -11655,8 +11655,9 @@ declare interface WatchFileSystem { callback: ( arg0: undefined | Error, arg1: Map, - arg2: Set, - arg3: Set + arg2: Map, + arg3: Set, + arg4: Set ) => void, callbackUndelayed: (arg0: string, arg1: number) => void ) => Watcher;