Bug 1595046 - Make it possible to inspect every exception value in the web console. r=jonco,baku,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D64437
This commit is contained in:
Tom Schuster
2020-05-08 20:54:17 +00:00
parent 800f9c248e
commit a7887ce4fb
13 changed files with 194 additions and 54 deletions

View File

@@ -9,6 +9,7 @@
#include "mozilla/BasePrincipal.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/ThreadLocal.h"
#include "mozilla/Maybe.h"
#include "mozilla/dom/JSExecutionManager.h"
#include "mozilla/dom/WorkerPrivate.h"
@@ -521,7 +522,9 @@ void AutoJSAPI::ReportException() {
xpc::FindExceptionStackForConsoleReport(inner, exnStack.exception(),
exnStack.stack(), &stack,
&stackGlobal);
xpcReport->LogToConsoleWithStack(stack, stackGlobal);
JS::Rooted<Maybe<JS::Value>> exception(cx(),
Some(exnStack.exception()));
xpcReport->LogToConsoleWithStack(inner, exception, stack, stackGlobal);
}
} else {
// On a worker or worklet, we just use the error reporting mechanism and