From 0b014a39e9cf31277ab118047b49be382df0cae1 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 11 Jan 2013 09:42:59 +0100 Subject: [PATCH] Bug 828244 - Part b: Pass MutableHandleValue to Debugger::resultToCompletion; r=terrence --- js/src/vm/Debugger.cpp | 12 ++++++------ js/src/vm/Debugger.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 77fbebc7826a..4100cba91a6b 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -517,7 +517,7 @@ Debugger::slowPathOnLeaveFrame(JSContext *cx, bool frameOk) /* Save the frame's completion value. */ JSTrapStatus status; 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. */ AutoObjectVector frames(cx); @@ -756,20 +756,20 @@ Debugger::handleUncaughtException(Maybe &ac, Value *vp, bool ca void Debugger::resultToCompletion(JSContext *cx, bool ok, const Value &rv, - JSTrapStatus *status, Value *value) + JSTrapStatus *status, MutableHandleValue value) { JS_ASSERT_IF(ok, !cx->isExceptionPending()); if (ok) { *status = JSTRAP_RETURN; - *value = rv; + value.set(rv); } else if (cx->isExceptionPending()) { *status = JSTRAP_THROW; - *value = cx->getPendingException(); + value.set(cx->getPendingException()); cx->clearPendingException(); } else { *status = JSTRAP_ERROR; - value->setUndefined(); + value.setUndefined(); } } @@ -822,7 +822,7 @@ Debugger::receiveCompletionValue(Maybe &ac, bool ok, Value val, JSContext *cx = ac.ref().context(); JSTrapStatus status; - Value value; + RootedValue value(cx); resultToCompletion(cx, ok, val, &status, &value); ac.destroy(); return newCompletionValue(cx, status, value, vp); diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index 354cda66f51d..257480fd5d0e 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -464,7 +464,7 @@ class Debugger : private mozilla::LinkedListElement * to be false). */ 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|