Fix build bustage by not using debug-only member in opt code. Bug 398668

This commit is contained in:
bzbarsky@mit.edu 2007-10-05 18:23:09 -07:00
Родитель 080b478af0
Коммит 98f7334314
4 изменённых файлов: 11 добавлений и 9 удалений

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

@ -99,6 +99,10 @@ public:
// return means a JS exception was set.
PRBool ResolveAllFields(JSContext *cx, JSObject *obj) const;
PRBool CompiledMembers() const {
return mClassObject != nsnull;
}
protected:
// Function to call if compilation of a member fails. When this is called,
// all members before aBrokenMember are compiled, compilation of

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

@ -287,13 +287,7 @@ nsXBLProtoImplMethod::Traverse(nsCycleCollectionTraversalCallback &cb) const
nsresult
nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
{
if (!mIsCompiled) {
// Someone might have enabled script between when the binding would have
// been compiled and now. If this is the constructor we shouldn't run it
// because our other scripted stuff is not set up, and if it's the
// destructor then the constructor never ran. In either case, bail out.
return NS_OK;
}
NS_PRECONDITION(mIsCompiled, "Can't execute uncompiled method");
if (!mJSMethodObject) {
// Nothing to do here

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

@ -137,7 +137,9 @@ protected:
JSObject * mJSMethodObject; // The JS object for the method (after compilation)
};
#ifdef DEBUG
PRBool mIsCompiled;
#endif
};
class nsXBLProtoImplAnonymousMethod : public nsXBLProtoImplMethod {

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

@ -473,7 +473,8 @@ nsXBLPrototypeBinding::FlushSkinSheets()
nsresult
nsXBLPrototypeBinding::BindingAttached(nsIContent* aBoundElement)
{
if (mImplementation && mImplementation->mConstructor)
if (mImplementation && mImplementation->CompiledMembers() &&
mImplementation->mConstructor)
return mImplementation->mConstructor->Execute(aBoundElement);
return NS_OK;
}
@ -481,7 +482,8 @@ nsXBLPrototypeBinding::BindingAttached(nsIContent* aBoundElement)
nsresult
nsXBLPrototypeBinding::BindingDetached(nsIContent* aBoundElement)
{
if (mImplementation && mImplementation->mDestructor)
if (mImplementation && mImplementation->CompiledMembers() &&
mImplementation->mDestructor)
return mImplementation->mDestructor->Execute(aBoundElement);
return NS_OK;
}