refactor(core): match spec updates for FakeNavigation

Updates FakeNavigation based on updates in https://github.com/whatwg/html/pull/11952

(cherry picked from commit d355205198)
This commit is contained in:
Andrew Scott 2025-11-25 12:28:44 -08:00 committed by Alex Rickabaugh
parent 84f397c831
commit 01ab257da4

View file

@ -956,10 +956,8 @@ function dispatchNavigateEvent({
}
}
(navigation.transition as InternalNavigationTransition)?.committedResolve();
const promisesList = handlers.map((handler) => handler());
if (promisesList.length === 0) {
promisesList.push(Promise.resolve());
}
const promisesList: Array<Promise<unknown>> = handlers.map((handler) => handler());
promisesList.push(result.committed);
Promise.all(promisesList)
.then(() => {
// Follows steps outlined under "Wait for all of promisesList, with the following success steps:"