Bug 1871442 - better to handle an unexpected case rather than just debug-only assert about it, r=decoder

Differential Revision: https://phabricator.services.mozilla.com/D197773
This commit is contained in:
Olli Pettay 2024-01-05 11:44:43 +00:00
parent ff6752ce82
commit e252aa4f62

View file

@ -5156,7 +5156,9 @@ mozilla::ipc::IPCResult ContentParent::RecvScriptErrorInternal(
}
JS::Rooted<JSObject*> stackObj(cx, &stack.toObject());
MOZ_ASSERT(JS::IsUnwrappedSavedFrame(stackObj));
if (!JS::IsUnwrappedSavedFrame(stackObj)) {
return IPC_FAIL(this, "Unexpected object");
}
JS::Rooted<JSObject*> stackGlobal(cx, JS::GetNonCCWObjectGlobal(stackObj));
msg = new nsScriptErrorWithStack(JS::NothingHandleValue, stackObj,