Skip to content

Commit

Permalink
Bug 922837 - In IndexedDatabaseManager.cpp:235: Assertion failure: js…
Browse files Browse the repository at this point in the history
…::GetObjectClass(aGlobal)->flags & (1<<7) (Not a global object!). r=bholley
  • Loading branch information
janvarga committed Oct 2, 2013
1 parent 29776b4 commit b7a1701
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dom/indexedDB/IndexedDatabaseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b7a1701

Please sign in to comment.