Bug 930427 - Improve debugger weakmap assertions r=billm

This commit is contained in:
Jon Coppeard 2013-11-26 10:23:32 +00:00
parent 5936c394b3
commit f12f638b40

View File

@ -78,6 +78,7 @@ class DebuggerWeakMap : private WeakMap<Key, Value, DefaultHasher<Key> >
template<typename KeyInput, typename ValueInput>
bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {
JS_ASSERT(v->compartment() == Base::compartment);
JS_ASSERT(!p.found());
if (!incZoneCount(k->zone()))
return false;
bool ok = Base::relookupOrAdd(p, k, v);
@ -87,6 +88,7 @@ class DebuggerWeakMap : private WeakMap<Key, Value, DefaultHasher<Key> >
}
void remove(const Lookup &l) {
JS_ASSERT(Base::has(l));
Base::remove(l);
decZoneCount(l->zone());
}