Bug 878325 - Propagate exceptions out of ResolveForwardReferences. r=bz

This commit is contained in:
Bobby Holley 2013-06-03 11:27:42 -07:00
parent 2dd3c038b4
commit 1061cd85c9

View File

@ -1171,6 +1171,7 @@ XULDocument::ResolveForwardReferences()
// guaranteed to converge because we've "closed the gate" to new
// forward references.
nsresult rv = NS_OK;
const nsForwardReference::Phase* pass = nsForwardReference::kPasses;
while ((mResolutionPhase = *pass) != nsForwardReference::eDone) {
uint32_t previous = 0;
@ -1185,8 +1186,10 @@ XULDocument::ResolveForwardReferences()
nsForwardReference::Result result = fwdref->Resolve();
switch (result) {
case nsForwardReference::eResolve_Succeeded:
case nsForwardReference::eResolve_Error:
rv = NS_ERROR_FAILURE;
// Fall through.
case nsForwardReference::eResolve_Succeeded:
mForwardReferences.RemoveElementAt(i);
// fixup because we removed from list
@ -1202,7 +1205,7 @@ XULDocument::ResolveForwardReferences()
// Resolve() loaded a dynamic overlay,
// (see XULDocument::LoadOverlayInternal()).
// Return for now, we will be called again.
return NS_OK;
return rv;
}
}
}
@ -1212,7 +1215,7 @@ XULDocument::ResolveForwardReferences()
}
mForwardReferences.Clear();
return NS_OK;
return rv;
}
NS_IMETHODIMP