perf: use .abort.bind() instead of arrow closures to prevent memory leaks (#7174)

This commit is contained in:
Marcus Castro
2026-02-06 20:30:29 -03:00
committed by Peter Steinberger
parent d637a26350
commit d9c582627c
12 changed files with 17 additions and 17 deletions

View File

@@ -50,8 +50,8 @@ function buildAbortSignal(params: { timeoutMs?: number; signal?: AbortSignal }):
}
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
const onAbort = () => controller.abort();
const timeoutId = setTimeout(controller.abort.bind(controller), timeoutMs);
const onAbort = controller.abort.bind(controller);
if (signal) {
if (signal.aborted) {
controller.abort();