Bug 1790765 - Replace superstitious comment in ScriptLoader::MaybeMoveToLoadedList with release assertion r=smaug

An initial try is green with this change.

Differential Revision: https://phabricator.services.mozilla.com/D157304
This commit is contained in:
Jon Coppeard
2022-09-15 09:14:59 +00:00
parent 683e1a9c63
commit b2d0457dd0

View File

@@ -3628,16 +3628,10 @@ void ScriptLoader::MaybeMoveToLoadedList(ScriptLoadRequest* aRequest) {
MOZ_ASSERT(aRequest->IsReadyToRun());
MOZ_ASSERT(aRequest->IsTopLevel());
// If it's async, move it to the loaded list.
// aRequest->GetScriptLoadContext()->mInAsyncList really _should_ be in a
// list, but the consequences if it's not are bad enough we want to avoid
// trying to move it if it's not.
if (aRequest->GetScriptLoadContext()->mInAsyncList) {
MOZ_ASSERT(aRequest->isInList());
if (aRequest->isInList()) {
RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
mLoadedAsyncRequests.AppendElement(req);
}
MOZ_RELEASE_ASSERT(aRequest->isInList());
RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
mLoadedAsyncRequests.AppendElement(req);
} else if (aRequest->IsModuleRequest() &&
aRequest->AsModuleRequest()->IsDynamicImport()) {
// Process dynamic imports with async scripts.