Bug 828244 - Part b: Pass MutableHandleValue to Debugger::resultToCompletion; r=terrence

This commit is contained in:
Ms2ger 2013-01-11 09:42:59 +01:00
parent 78663c51a3
commit 0b014a39e9
2 changed files with 7 additions and 7 deletions

View File

@ -517,7 +517,7 @@ Debugger::slowPathOnLeaveFrame(JSContext *cx, bool frameOk)
/* Save the frame's completion value. */ /* Save the frame's completion value. */
JSTrapStatus status; JSTrapStatus status;
RootedValue value(cx); RootedValue value(cx);
Debugger::resultToCompletion(cx, frameOk, fp->returnValue(), &status, value.address()); Debugger::resultToCompletion(cx, frameOk, fp->returnValue(), &status, &value);
/* Build a list of the recipients. */ /* Build a list of the recipients. */
AutoObjectVector frames(cx); AutoObjectVector frames(cx);
@ -756,20 +756,20 @@ Debugger::handleUncaughtException(Maybe<AutoCompartment> &ac, Value *vp, bool ca
void void
Debugger::resultToCompletion(JSContext *cx, bool ok, const Value &rv, Debugger::resultToCompletion(JSContext *cx, bool ok, const Value &rv,
JSTrapStatus *status, Value *value) JSTrapStatus *status, MutableHandleValue value)
{ {
JS_ASSERT_IF(ok, !cx->isExceptionPending()); JS_ASSERT_IF(ok, !cx->isExceptionPending());
if (ok) { if (ok) {
*status = JSTRAP_RETURN; *status = JSTRAP_RETURN;
*value = rv; value.set(rv);
} else if (cx->isExceptionPending()) { } else if (cx->isExceptionPending()) {
*status = JSTRAP_THROW; *status = JSTRAP_THROW;
*value = cx->getPendingException(); value.set(cx->getPendingException());
cx->clearPendingException(); cx->clearPendingException();
} else { } else {
*status = JSTRAP_ERROR; *status = JSTRAP_ERROR;
value->setUndefined(); value.setUndefined();
} }
} }
@ -822,7 +822,7 @@ Debugger::receiveCompletionValue(Maybe<AutoCompartment> &ac, bool ok, Value val,
JSContext *cx = ac.ref().context(); JSContext *cx = ac.ref().context();
JSTrapStatus status; JSTrapStatus status;
Value value; RootedValue value(cx);
resultToCompletion(cx, ok, val, &status, &value); resultToCompletion(cx, ok, val, &status, &value);
ac.destroy(); ac.destroy();
return newCompletionValue(cx, status, value, vp); return newCompletionValue(cx, status, value, vp);

View File

@ -464,7 +464,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
* to be false). * to be false).
*/ */
static void resultToCompletion(JSContext *cx, bool ok, const Value &rv, static void resultToCompletion(JSContext *cx, bool ok, const Value &rv,
JSTrapStatus *status, Value *value); JSTrapStatus *status, MutableHandleValue value);
/* /*
* Set |*result| to a JavaScript completion value corresponding to |status| * Set |*result| to a JavaScript completion value corresponding to |status|