mirror of https://github.com/nodejs/node.git
watch: use internal addAbortListener
PR-URL: https://github.com/nodejs/node/pull/52081 Refs: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
780d030bdf
commit
fec7e505fc
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue