Issue #2089 - Use JS engine stack if necessary when reporting errors

Based-on: m-c 996060
This commit is contained in:
Martok 2023-01-21 02:13:01 +01:00 committed by roytam1
commit 6b50dd5d06
21 changed files with 209 additions and 69 deletions

View file

@ -274,6 +274,12 @@ public:
// into the current compartment.
MOZ_MUST_USE bool StealException(JS::MutableHandle<JS::Value> aVal);
// As for StealException(), but put the saved frames for any stack trace
// associated with the point the exception was thrown into aStack.
// aVal will be in the current compartment, but aStack might not be.
MOZ_MUST_USE bool StealExceptionAndStack(JS::MutableHandle<JS::Value> aVal,
JS::MutableHandle<JSObject*> aStack);
// Peek the current exception from the JS engine, without stealing it.
// Callers must ensure that HasException() is true, and that cx() is in a
// non-null compartment.