diff --git a/lib/internal/watch_mode/files_watcher.js b/lib/internal/watch_mode/files_watcher.js index 9e018045e520fd..e3f37557a627dc 100644 --- a/lib/internal/watch_mode/files_watcher.js +++ b/lib/internal/watch_mode/files_watcher.js @@ -13,6 +13,7 @@ const { kEmptyObject } = require('internal/util'); const { TIMEOUT_MAX } = require('internal/timers'); const EventEmitter = require('events'); +const { addAbortListener } = require('internal/events/abort_listener'); const { watch } = require('fs'); const { fileURLToPath } = require('internal/url'); const { resolve, dirname } = require('path'); @@ -41,7 +42,7 @@ class FilesWatcher extends EventEmitter { this.#signal = signal; if (signal) { - EventEmitter.addAbortListener(signal, () => this.clear()); + addAbortListener(signal, () => this.clear()); } }