mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Issue #2089 - Use JS engine stack if necessary when reporting errors
Based-on: m-c 996060
This commit is contained in:
parent
0216108195
commit
6b50dd5d06
21 changed files with 209 additions and 69 deletions
|
|
@ -408,12 +408,15 @@ ErrorCopier::~ErrorCopier()
|
|||
{
|
||||
RootedValue exc(cx);
|
||||
if (cx->getPendingException(&exc) && exc.isObject() && exc.toObject().is<ErrorObject>()) {
|
||||
RootedSavedFrame stack(cx, cx->getPendingExceptionStack());
|
||||
cx->clearPendingException();
|
||||
ac.reset();
|
||||
Rooted<ErrorObject*> errObj(cx, &exc.toObject().as<ErrorObject>());
|
||||
JSObject* copyobj = CopyErrorObject(cx, errObj);
|
||||
if (copyobj)
|
||||
cx->setPendingException(ObjectValue(*copyobj));
|
||||
if (copyobj) {
|
||||
RootedValue rootedCopy(cx, ObjectValue(*copyobj));
|
||||
cx->setPendingException(rootedCopy, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue