Bug 784706 - clear proxiedScopes in DebugScopes::onCompartmentLeaveDebugMode (r=jimb)

This commit is contained in:
Luke Wagner 2012-08-23 10:58:24 -07:00
parent 1e17d124a3
commit f9aafd561f
2 changed files with 6 additions and 2 deletions

View File

@ -150,9 +150,9 @@ template <class Key, class Value,
class WeakMap : public HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy>, public WeakMapBase {
private:
typedef HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy> Base;
typedef typename Base::Enum Enum;
public:
typedef typename Base::Enum Enum;
typedef typename Base::Range Range;
explicit WeakMap(JSRuntime *rt, JSObject *memOf=NULL) : Base(rt), WeakMapBase(memOf) { }

View File

@ -1663,7 +1663,7 @@ DebugScopes::onPopCall(StackFrame *fp, JSContext *cx)
/*
* When the StackFrame is popped, the values of unaliased variables
* are lost. If there is any debug scope referring to this scope, save a
* copy of the unaliased variables' values in an array for latter debugger
* copy of the unaliased variables' values in an array for later debugger
* access via DebugScopeProxy::handleUnaliasedAccess.
*
* Note: since it is simplest for this function to be infallible, failure
@ -1776,6 +1776,10 @@ DebugScopes::onGeneratorFrameChange(StackFrame *from, StackFrame *to, JSContext
void
DebugScopes::onCompartmentLeaveDebugMode(JSCompartment *c)
{
for (ObjectWeakMap::Enum e(proxiedScopes); !e.empty(); e.popFront()) {
if (e.front().key->compartment() == c)
e.removeFront();
}
for (MissingScopeMap::Enum e(missingScopes); !e.empty(); e.popFront()) {
if (e.front().key.fp()->compartment() == c)
e.removeFront();