Bug 922837 - In IndexedDatabaseManager.cpp:235: Assertion failure: js::GetObjectClass(aGlobal)->flags & (1<<7) (Not a global object!). r=bholley

This commit is contained in:
Jan Varga 2013-10-02 15:34:58 +02:00
parent 1206bb4769
commit 44b5ad85cf

View File

@ -231,18 +231,21 @@ IndexedDBLazyGetter(JSContext* aCx, JS::HandleObject aGlobal,
JS::HandleId aId, JS::MutableHandleValue aVp)
{
MOZ_ASSERT(nsContentUtils::IsCallerChrome(), "Only for chrome!");
MOZ_ASSERT(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL,
"Not a global object!");
MOZ_ASSERT(JSID_IS_STRING(aId), "Bad id!");
MOZ_ASSERT(JS_FlatStringEqualsAscii(JSID_TO_FLAT_STRING(aId), IDB_STR),
"Bad id!");
JS::RootedObject global(aCx, CheckedUnwrap(aGlobal,
/* stopAtOuter = */ false));
NS_ENSURE_TRUE(global, false);
NS_ENSURE_TRUE(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL, false);
JS::RootedValue indexedDB(aCx);
if (!GetIndexedDB(aCx, aGlobal, &indexedDB)) {
if (!GetIndexedDB(aCx, global, &indexedDB)) {
return false;
}
if (!JS_DefinePropertyById(aCx, aGlobal, aId, indexedDB, nullptr, nullptr,
if (!JS_DefinePropertyById(aCx, global, aId, indexedDB, nullptr, nullptr,
JSPROP_ENUMERATE)) {
return false;
}