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
parent 406024c657
commit 9fecf5cc61
4 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

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

View File

@ -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;
}