Skip to content

Commit 8ba6f9b

Browse files
atlowChemimarco-ippolito
authored andcommitted
watch: use internal addAbortListener
PR-URL: #52081 Refs: #48596 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 68187c4 commit 8ba6f9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/watch_mode/files_watcher.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const { kEmptyObject } = require('internal/util');
1313
const { TIMEOUT_MAX } = require('internal/timers');
1414

1515
const EventEmitter = require('events');
16+
const { addAbortListener } = require('internal/events/abort_listener');
1617
const { watch } = require('fs');
1718
const { fileURLToPath } = require('internal/url');
1819
const { resolve, dirname } = require('path');
@@ -41,7 +42,7 @@ class FilesWatcher extends EventEmitter {
4142
this.#signal = signal;
4243

4344
if (signal) {
44-
EventEmitter.addAbortListener(signal, () => this.clear());
45+
addAbortListener(signal, () => this.clear());
4546
}
4647
}
4748

0 commit comments

Comments
 (0)