Allow entering a compartment with a pending exception (bug 626267, r=luke).

This commit is contained in:
Andreas Gal 2011-01-17 14:21:03 -08:00
parent ec712fc18c
commit ffad8e83db

View File

@ -348,9 +348,6 @@ AutoCompartment::enter()
if (origin != destination) {
LeaveTrace(context);
if (context->isExceptionPending())
return false;
context->compartment = destination;
JSObject *scopeChain = target->getGlobal();
JS_ASSERT(scopeChain->isNative());
@ -360,6 +357,9 @@ AutoCompartment::enter()
context->compartment = origin;
return false;
}
if (context->isExceptionPending())
context->wrapPendingException();
}
entered = true;
return true;