Bug 773590 - Display the return value when stepping out of a function; r=vporof
This commit is contained in:
@@ -428,6 +428,7 @@ StackFrames.prototype = {
|
||||
currentBreakpointLocation: null,
|
||||
currentEvaluation: null,
|
||||
currentException: null,
|
||||
currentReturnedValue: null,
|
||||
|
||||
/**
|
||||
* Connect to the current thread client.
|
||||
@@ -485,6 +486,17 @@ StackFrames.prototype = {
|
||||
case "exception":
|
||||
this.currentException = aPacket.why.exception;
|
||||
break;
|
||||
// If paused while stepping out of a frame, store the returned value or
|
||||
// thrown exception.
|
||||
case "resumeLimit":
|
||||
if (!aPacket.why.frameFinished) {
|
||||
break;
|
||||
} else if (aPacket.why.frameFinished.throw) {
|
||||
this.currentException = aPacket.why.frameFinished.throw;
|
||||
} else if (aPacket.why.frameFinished.return) {
|
||||
this.currentReturnedValue = aPacket.why.frameFinished.return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
this.activeThread.fillFrames(CALL_STACK_PAGE_SIZE);
|
||||
@@ -595,6 +607,7 @@ StackFrames.prototype = {
|
||||
this.currentBreakpointLocation = null;
|
||||
this.currentEvaluation = null;
|
||||
this.currentException = null;
|
||||
this.currentReturnedValue = null;
|
||||
// After each frame step (in, over, out), framescleared is fired, which
|
||||
// forces the UI to be emptied and rebuilt on framesadded. Most of the times
|
||||
// this is not necessary, and will result in a brief redraw flicker.
|
||||
@@ -832,6 +845,11 @@ StackFrames.prototype = {
|
||||
let excRef = aScope.addVar("<exception>", { value: this.currentException });
|
||||
this._addVarExpander(excRef, this.currentException);
|
||||
}
|
||||
// Add any returned value.
|
||||
if (this.currentReturnedValue) {
|
||||
let retRef = aScope.addVar("<return>", { value: this.currentReturnedValue });
|
||||
this._addVarExpander(retRef, this.currentReturnedValue);
|
||||
}
|
||||
// Add "this".
|
||||
if (aFrame.this) {
|
||||
let thisRef = aScope.addVar("this", { value: aFrame.this });
|
||||
|
||||
Reference in New Issue
Block a user