Bug 1099278 - Update nsGlobalWindow's StoreInSlot users to use a better error contract; r=bz

--HG--
extra : rebase_source : 7dd2ec19526925edfee8d819d99b7f892a0adbbb
This commit is contained in:
Terrence Cole 2014-11-14 16:54:10 -08:00
Родитель df4c5ce286
Коммит e22128b208
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -14094,8 +14094,12 @@ void
nsGlobalWindow::ClearDocumentDependentSlots(JSContext* aCx)
{
MOZ_ASSERT(IsInnerWindow());
WindowBinding::ClearCachedDocumentValue(aCx, this);
WindowBinding::ClearCachedPerformanceValue(aCx, this);
// If JSAPI OOMs here, there is basically nothing we can do to recover safely.
if (!WindowBinding::ClearCachedDocumentValue(aCx, this) ||
!WindowBinding::ClearCachedPerformanceValue(aCx, this)) {
MOZ_CRASH("Unhandlable OOM while clearing document dependent slots.");
}
}
/* static */

Просмотреть файл

@ -3474,7 +3474,6 @@ class CGClearCachedValueMethod(CGAbstractMethod):
JSAutoCompartment ac(aCx, obj);
if (!get_${name}(aCx, obj, aObject, args)) {
js::SetReservedSlot(obj, ${slotIndex}, oldValue);
nsJSUtils::ReportPendingException(aCx);
return false;
}
return true;