Bug 1202051 - Use a PersistentRooted to automate tracing of unwrappedException_; r=sfink

This commit is contained in:
Terrence Cole 2015-09-04 13:40:59 -07:00
parent 2ea26571c1
commit eaae78a40d
2 changed files with 2 additions and 6 deletions

View File

@ -947,7 +947,7 @@ ExclusiveContext::recoverFromOutOfMemory()
JSContext::JSContext(JSRuntime* rt)
: ExclusiveContext(rt, &rt->mainThread, Context_JS),
throwing(false),
unwrappedException_(UndefinedValue()),
unwrappedException_(this),
options_(),
overRecursed_(false),
propagatingForcedReturn_(false),
@ -1136,10 +1136,6 @@ JSContext::mark(JSTracer* trc)
{
/* Stack frames and slots are traced by StackSpace::mark. */
/* Mark other roots-by-definition in the JSContext. */
if (isExceptionPending())
TraceRoot(trc, &unwrappedException_, "unwrapped exception");
TraceCycleDetectionSet(trc, cycleDetectorSet);
if (compartment_)

View File

@ -305,7 +305,7 @@ struct JSContext : public js::ExclusiveContext,
private:
/* Exception state -- the exception member is a GC root by definition. */
bool throwing; /* is there a pending exception? */
js::Value unwrappedException_; /* most-recently-thrown exception */
JS::PersistentRooted<JS::Value> unwrappedException_; /* most-recently-thrown exception */
/* Per-context options. */
JS::ContextOptions options_;