Bug 1474385 - Part 1: Rename and comment a Debugger method involved in error handling. r=jimb

We will in fact delete this method later in the stack, but to understand those
coming patches, it helps to understand what's going on here.

--HG--
extra : rebase_source : a8532831cb37aab4e346a58db09a9c7a7496de1b
This commit is contained in:
Jason Orendorff 2018-07-06 18:04:50 -05:00
Родитель 8d6ed6332a
Коммит 608042606b
2 изменённых файлов: 22 добавлений и 8 удалений

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

@ -1422,8 +1422,11 @@ Debugger::handleUncaughtExceptionHelper(Maybe<AutoRealm>& ar, MutableHandleValue
if (js::Call(cx, fval, object, exc, &rv)) {
if (vp) {
ResumeMode resumeMode = ResumeMode::Continue;
if (processResumptionValue(ar, frame, thisVForCheck, rv, resumeMode, *vp))
if (processResumptionValueNoUncaughtExceptionHook(ar, frame, thisVForCheck, rv,
resumeMode, *vp))
{
return resumeMode;
}
} else {
return ResumeMode::Continue;
}
@ -1634,9 +1637,10 @@ GetThisValueForCheck(JSContext* cx, AbstractFramePtr frame, jsbytecode* pc,
}
bool
Debugger::processResumptionValue(Maybe<AutoRealm>& ar, AbstractFramePtr frame,
const Maybe<HandleValue>& maybeThisv, HandleValue rval,
ResumeMode& resumeMode, MutableHandleValue vp)
Debugger::processResumptionValueNoUncaughtExceptionHook(
Maybe<AutoRealm>& ar, AbstractFramePtr frame,
const Maybe<HandleValue>& maybeThisv, HandleValue rval,
ResumeMode& resumeMode, MutableHandleValue vp)
{
JSContext* cx = ar->context();

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

@ -607,7 +607,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
*
* Precondition: ar is entered. We are in the debugger compartment.
*
* Postcondition: This called ar.leave(). See handleUncaughtException.
* Postcondition: This called ar.reset(). See handleUncaughtException.
*
* If `success` is false, the hook failed. If an exception is pending in
* ar.context(), return handleUncaughtException(ar, vp, callhook).
@ -644,9 +644,19 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
bool success, ResumeMode resumeMode,
MutableHandleValue vp);
bool processResumptionValue(mozilla::Maybe<AutoRealm>& ar, AbstractFramePtr frame,
const mozilla::Maybe<HandleValue>& maybeThis, HandleValue rval,
ResumeMode& resumeMode, MutableHandleValue vp);
/*
* Like processHandlerResult, but if `rval` is not a valid resumption value,
* don't call the uncaughtExceptionHook. Just return false.
*
* This is used to process the return value of the uncaughtExceptionHook
* itself, to avoid the possibility of triggering it again.
*/
bool processResumptionValueNoUncaughtExceptionHook(mozilla::Maybe<AutoRealm>& ar,
AbstractFramePtr frame,
const mozilla::Maybe<HandleValue>& maybeThis,
HandleValue rval,
ResumeMode& resumeMode,
MutableHandleValue vp);
GlobalObject* unwrapDebuggeeArgument(JSContext* cx, const Value& v);