mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 902718 - Add a mechanism to assert that the stack-top cx is an XBL compilation scope. r=bz
This commit is contained in:
parent
3f88a39464
commit
cde56ff019
@ -78,6 +78,8 @@ public:
|
||||
|
||||
void UnmarkScriptContext();
|
||||
|
||||
static JSClass gSharedGlobalClass;
|
||||
|
||||
protected:
|
||||
virtual ~nsXBLDocGlobalObject();
|
||||
|
||||
@ -87,7 +89,6 @@ protected:
|
||||
JSObject *mJSObject;
|
||||
|
||||
nsXBLDocumentInfo* mGlobalObjectOwner; // weak reference
|
||||
static JSClass gSharedGlobalClass;
|
||||
};
|
||||
|
||||
bool
|
||||
@ -713,3 +714,13 @@ nsXBLDocumentInfo::GetScriptGlobalObject()
|
||||
|
||||
return mGlobalObject;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
AssertInCompilationScope()
|
||||
{
|
||||
AutoJSContext cx;
|
||||
MOZ_ASSERT(JS_GetClass(JS::CurrentGlobalOrNull(cx)) ==
|
||||
&nsXBLDocGlobalObject::gSharedGlobalClass);
|
||||
}
|
||||
#endif
|
||||
|
@ -70,4 +70,10 @@ private:
|
||||
nsRefPtr<nsXBLDocGlobalObject> mGlobalObject;
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
void AssertInCompilationScope();
|
||||
#else
|
||||
inline void AssertInCompilationScope() {}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user