зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1294013 - Factor out processResumptionValue. r=jimb
This commit is contained in:
Родитель
ec711a007e
Коммит
2bf9548b9c
|
@ -1536,6 +1536,29 @@ CheckResumptionValue(JSContext* cx, AbstractFramePtr frame, const Maybe<HandleVa
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Debugger::processResumptionValue(Maybe<AutoCompartment>& ac, AbstractFramePtr frame,
|
||||||
|
const Maybe<HandleValue>& maybeThisv, HandleValue rval,
|
||||||
|
JSTrapStatus* statusp, MutableHandleValue vp)
|
||||||
|
{
|
||||||
|
JSContext* cx = ac->context()->asJSContext();
|
||||||
|
|
||||||
|
if (!ParseResumptionValue(cx, rval, statusp, vp) ||
|
||||||
|
!unwrapDebuggeeValue(cx, vp) ||
|
||||||
|
!CheckResumptionValue(cx, frame, maybeThisv, *statusp, vp))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ac.reset();
|
||||||
|
if (!cx->compartment()->wrap(cx, vp)) {
|
||||||
|
*statusp = JSTRAP_ERROR;
|
||||||
|
vp.setUndefined();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
JSTrapStatus
|
JSTrapStatus
|
||||||
Debugger::parseResumptionValueHelper(Maybe<AutoCompartment>& ac, bool ok, const Value& rv,
|
Debugger::parseResumptionValueHelper(Maybe<AutoCompartment>& ac, bool ok, const Value& rv,
|
||||||
const Maybe<HandleValue>& thisVForCheck, AbstractFramePtr frame,
|
const Maybe<HandleValue>& thisVForCheck, AbstractFramePtr frame,
|
||||||
|
@ -1549,20 +1572,9 @@ Debugger::parseResumptionValueHelper(Maybe<AutoCompartment>& ac, bool ok, const
|
||||||
RootedValue rvRoot(cx, rv);
|
RootedValue rvRoot(cx, rv);
|
||||||
JSTrapStatus status = JSTRAP_CONTINUE;
|
JSTrapStatus status = JSTRAP_CONTINUE;
|
||||||
RootedValue v(cx);
|
RootedValue v(cx);
|
||||||
if (!ParseResumptionValue(cx, rvRoot, &status, &v) ||
|
if (!processResumptionValue(ac, frame, thisVForCheck, rvRoot, &status, &v))
|
||||||
!unwrapDebuggeeValue(cx, &v) ||
|
|
||||||
!CheckResumptionValue(cx, frame, thisVForCheck, status, &v))
|
|
||||||
{
|
|
||||||
return handleUncaughtException(ac, vp, callHook, thisVForCheck, frame);
|
return handleUncaughtException(ac, vp, callHook, thisVForCheck, frame);
|
||||||
}
|
|
||||||
|
|
||||||
ac.reset();
|
|
||||||
if (!cx->compartment()->wrap(cx, &v)) {
|
|
||||||
vp.setUndefined();
|
|
||||||
return JSTRAP_ERROR;
|
|
||||||
}
|
|
||||||
vp.set(v);
|
vp.set(v);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -566,6 +566,10 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
const mozilla::Maybe<HandleValue>& thisVForCheck, AbstractFramePtr frame,
|
const mozilla::Maybe<HandleValue>& thisVForCheck, AbstractFramePtr frame,
|
||||||
MutableHandleValue vp, bool callHook);
|
MutableHandleValue vp, bool callHook);
|
||||||
|
|
||||||
|
bool processResumptionValue(mozilla::Maybe<AutoCompartment>& ac, AbstractFramePtr frame,
|
||||||
|
const mozilla::Maybe<HandleValue>& maybeThis, HandleValue rval,
|
||||||
|
JSTrapStatus* statusp, MutableHandleValue vp);
|
||||||
|
|
||||||
GlobalObject* unwrapDebuggeeArgument(JSContext* cx, const Value& v);
|
GlobalObject* unwrapDebuggeeArgument(JSContext* cx, const Value& v);
|
||||||
|
|
||||||
static void traceObject(JSTracer* trc, JSObject* obj);
|
static void traceObject(JSTracer* trc, JSObject* obj);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче