From d970748eed3dda6bdf678a77fa8f748c5ea678df Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 3 Mar 2025 12:15:10 +0000 Subject: [PATCH] LibWeb/HTML: Assert that a finished promise has a committed-to-entry Corresponds to https://github.com/whatwg/html/commit/12c6ce02d8c7201313176477c50691ea3f340c95 --- Libraries/LibWeb/HTML/Navigation.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/HTML/Navigation.cpp b/Libraries/LibWeb/HTML/Navigation.cpp index 0146e3ae50a..74d9983201e 100644 --- a/Libraries/LibWeb/HTML/Navigation.cpp +++ b/Libraries/LibWeb/HTML/Navigation.cpp @@ -854,11 +854,8 @@ void Navigation::resolve_the_finished_promise(GC::Refrealm(); - // 1. Resolve apiMethodTracker's committed promise with its committed-to entry. - // NOTE: Usually, notify about the committed-to entry has previously been called on apiMethodTracker, - // and so this will do nothing. However, in some cases resolve the finished promise is called - // directly, in which case this step is necessary. - WebIDL::resolve_promise(realm, api_method_tracker->committed_promise, api_method_tracker->commited_to_entry); + // 1. Assert: apiMethodTracker's committed-to entry is not null. + VERIFY(api_method_tracker->commited_to_entry != nullptr); // 2. Resolve apiMethodTracker's finished promise with its committed-to entry. WebIDL::resolve_promise(realm, api_method_tracker->finished_promise, api_method_tracker->commited_to_entry);