Skip to content

Commit

Permalink
watch: use internal addAbortListener
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
atlowChemi authored and nodejs-github-bot committed Mar 16, 2024
1 parent 780d030 commit fec7e50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/watch_mode/files_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -41,7 +42,7 @@ class FilesWatcher extends EventEmitter {
this.#signal = signal;

if (signal) {
EventEmitter.addAbortListener(signal, () => this.clear());
addAbortListener(signal, () => this.clear());
}
}

Expand Down

0 comments on commit fec7e50

Please sign in to comment.