From 2a4ae8f1d892902d3ebfd0f7c1e2409af1f24044 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Thu, 3 Dec 2026 17:43:57 -0800 Subject: [PATCH] Avoid mutating handles array in closeHandles() --- lib/destination-claim.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/destination-claim.js b/lib/destination-claim.js index 42c427a8..21fe3f07 100644 --- a/lib/destination-claim.js +++ b/lib/destination-claim.js @@ -45,7 +45,7 @@ function * ancestors (path) { /** @param {FileHandle[]} handles */ async function closeHandles (handles) { - const closed = await Promise.allSettled(handles.reverse().map(handle => handle.close())) + const closed = await Promise.allSettled(handles.toReversed().map(handle => handle.close())) const errors = closed.flatMap(result => result.status === 'rejected' ? [result.reason] : []) if (errors.length > 0) throw new AggregateError(errors, 'Could not release domstack destination locks') }