Make sure to propagate back the result of InstallImplementation and bail

if it fails.  Bug 292944, r+sr=jst, a=asa
This commit is contained in:
bzbarsky%mit.edu 2005-06-11 21:30:20 +00:00
Родитель 10fe0f8c6a
Коммит c85bc2738e
3 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -721,18 +721,22 @@ nsXBLBinding::InstallEventHandlers()
mNextBinding->InstallEventHandlers();
}
void
nsresult
nsXBLBinding::InstallImplementation()
{
// Always install the base class properties first, so that
// derived classes can reference the base class properties.
if (mNextBinding)
mNextBinding->InstallImplementation();
if (mNextBinding) {
nsresult rv = mNextBinding->InstallImplementation();
NS_ENSURE_SUCCESS(rv, rv);
}
// iterate through each property in the prototype's list and install the property.
if (AllowScripts())
mPrototypeBinding->InstallImplementation(mBoundElement);
return mPrototypeBinding->InstallImplementation(mBoundElement);
return NS_OK;
}
nsIAtom*

Просмотреть файл

@ -111,7 +111,7 @@ public:
void GenerateAnonymousContent();
void InstallAnonymousContent(nsIContent* aAnonParent, nsIContent* aElement);
void InstallEventHandlers();
void InstallImplementation();
nsresult InstallImplementation();
void ExecuteAttachedHandler();
void ExecuteDetachedHandler();

Просмотреть файл

@ -639,7 +639,8 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL, PRBool aAugmentFl
newBinding->InstallEventHandlers();
// Set up our properties
newBinding->InstallImplementation();
rv = newBinding->InstallImplementation();
NS_ENSURE_SUCCESS(rv, rv);
// Figure out if we need to execute a constructor.
*aBinding = newBinding->GetFirstBindingWithConstructor();