зеркало из https://github.com/mozilla/gecko-dev.git
Bug 834732 - Assert proper cx stack handling in WrapperFactory::Rewrap. r=mrbkap
This commit is contained in:
Родитель
fd44dad2a6
Коммит
17eaab9c51
|
@ -492,6 +492,7 @@ nsXPCWrappedJSClass::IsWrappedJS(nsISupports* aPtr)
|
|||
result == WrappedJSIdentity::GetSingleton();
|
||||
}
|
||||
|
||||
// NB: This returns null unless there's nothing on the JSContext stack.
|
||||
static JSContext *
|
||||
GetContextFromObject(JSObject *obj)
|
||||
{
|
||||
|
|
|
@ -341,6 +341,9 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *existing, JSObject *obj,
|
|||
"wrapped object passed to rewrap");
|
||||
MOZ_ASSERT(JS_GetClass(obj) != &XrayUtils::HolderClass, "trying to wrap a holder");
|
||||
MOZ_ASSERT(!js::IsInnerObject(obj));
|
||||
// We sometimes end up here after nsContentUtils has been shut down but before
|
||||
// XPConnect has been shut down, so check the context stack the roundabout way.
|
||||
MOZ_ASSERT(XPCJSRuntime::Get()->GetJSContextStack()->Peek() == cx);
|
||||
|
||||
// Compute the information we need to select the right wrapper.
|
||||
JSCompartment *origin = js::GetObjectCompartment(obj);
|
||||
|
|
Загрузка…
Ссылка в новой задаче