зеркало из https://github.com/mozilla/gecko-dev.git
Bug 887334 - Enter a compartment between manual calls to JS_{Save,Restore}FrameChain. r=luke
The stuff in nsXBLProtoImplMethod is doing the same thing, so let's just have it call into nsJSUtils.
This commit is contained in:
Родитель
676b2c13a5
Коммит
a745bb206b
|
@ -347,10 +347,7 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
|||
// anything else. We just report it. Note that we need to set aside the
|
||||
// frame chain here, since the constructor invocation is not related to
|
||||
// whatever is on the stack right now, really.
|
||||
JSBool saved = JS_SaveFrameChain(cx);
|
||||
JS_ReportPendingException(cx);
|
||||
if (saved)
|
||||
JS_RestoreFrameChain(cx);
|
||||
nsJSUtils::ReportPendingException(cx);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ nsJSUtils::ReportPendingException(JSContext *aContext)
|
|||
{
|
||||
if (JS_IsExceptionPending(aContext)) {
|
||||
bool saved = JS_SaveFrameChain(aContext);
|
||||
JS_ReportPendingException(aContext);
|
||||
{
|
||||
JSAutoCompartment ac(aContext, js::GetDefaultGlobalForContext(aContext));
|
||||
JS_ReportPendingException(aContext);
|
||||
}
|
||||
if (saved) {
|
||||
JS_RestoreFrameChain(aContext);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче