function TA_onResume(aRequest) {
    if (aRequest && aRequest.forceCompletion) {
      // TODO: remove this when Debugger.Frame.prototype.pop is implemented in
      // bug 736733.
      if (typeof this.frame.pop != "function") {
        return { error: "notImplemented",
                 message: "forced completion is not yet implemented." };
      }

      this.dbg.getNewestFrame().pop(aRequest.completionValue);
      let packet = this._resumed();
      DebuggerServer.xpcInspector.exitNestedEventLoop();
      return { type: "resumeLimit", frameFinished: aRequest.forceCompletion };
    }

    if (aRequest && aRequest.resumeLimit) {
      // Bind these methods because some of the hooks are called with 'this'
      // set to the current frame.
      let pauseAndRespond = this._pauseAndRespond.bind(this);
      let createValueGrip = this.createValueGrip.bind(this);

      let startFrame = this._youngestFrame;
      let startLine;
      if (this._youngestFrame.script) {
        let offset = this._youngestFrame.offset;
        startLine = this._youngestFrame.script.getOffsetLine(offset);
      }

      // Define the JS hook functions for stepping.

      let onEnterFrame = function TA_onEnterFrame(aFrame) {
        return pauseAndRespond(aFrame, { type: "resumeLimit" });
      };

      let onPop = function TA_onPop(aCompletion) {
        // onPop is called with 'this' set to the current frame.

        // Note that we're popping this frame; we need to watch for
        // subsequent step events on its caller.
        this.reportedPop = true;

        return pauseAndRespond(this, { type: "resumeLimit" });
      }

      let onStep = function TA_onStep() {
        // onStep is called with 'this' set to the current frame.

        // If we've changed frame or line, then report that.
        if (this !== startFrame ||
            (this.script &&
             this.script.getOffsetLine(this.offset) != startLine)) {
          return pauseAndRespond(this, { type: "resumeLimit" });
        }

        // Otherwise, let execution continue.
        return undefined;
      }

      switch (aRequest.resumeLimit.type) {
        case "step":
          this.dbg.onEnterFrame = onEnterFrame;
          // Fall through.
        case "next":
          let stepFrame = this._getNextStepFrame(startFrame);
          if (stepFrame) {
            stepFrame.onStep = onStep;
            stepFrame.onPop = onPop;
          }
          break;
        case "finish":
          stepFrame = this._getNextStepFrame(startFrame);
          if (stepFrame) {
            stepFrame.onPop = onPop;
          }
          break;
        default:
          return { error: "badParameterType",
                   message: "Unknown resumeLimit type" };
      }
    }

    if (aRequest && aRequest.pauseOnExceptions) {
      this.dbg.onExceptionUnwind = this.onExceptionUnwind.bind(this);
    }
    let packet = this._resumed();
    DebuggerServer.xpcInspector.exitNestedEventLoop();
    return packet;
  }
/**
   * Handle a protocol request to resume execution of the debuggee.
   */
Handle a protocol request to resume execution of the debuggee.
Handle a protocol request to resume execution of the debuggee .
function TA_onResume(aRequest) {
    if (aRequest && aRequest.forceCompletion) {
      if (typeof this.frame.pop != "function") {
        return { error: "notImplemented",
                 message: "forced completion is not yet implemented." };
      }
      this.dbg.getNewestFrame().pop(aRequest.completionValue);
      let packet = this._resumed();
      DebuggerServer.xpcInspector.exitNestedEventLoop();
      return { type: "resumeLimit", frameFinished: aRequest.forceCompletion };
    }
    if (aRequest && aRequest.resumeLimit) {
      let pauseAndRespond = this._pauseAndRespond.bind(this);
      let createValueGrip = this.createValueGrip.bind(this);
      let startFrame = this._youngestFrame;
      let startLine;
      if (this._youngestFrame.script) {
        let offset = this._youngestFrame.offset;
        startLine = this._youngestFrame.script.getOffsetLine(offset);
      }
      let onEnterFrame = function TA_onEnterFrame(aFrame) {
        return pauseAndRespond(aFrame, { type: "resumeLimit" });
      };
      let onPop = function TA_onPop(aCompletion) {
        this.reportedPop = true;
        return pauseAndRespond(this, { type: "resumeLimit" });
      }
      let onStep = function TA_onStep() {
        if (this !== startFrame ||
            (this.script &&
             this.script.getOffsetLine(this.offset) != startLine)) {
          return pauseAndRespond(this, { type: "resumeLimit" });
        }
        return undefined;
      }
      switch (aRequest.resumeLimit.type) {
        case "step":
          this.dbg.onEnterFrame = onEnterFrame;
        case "next":
          let stepFrame = this._getNextStepFrame(startFrame);
          if (stepFrame) {
            stepFrame.onStep = onStep;
            stepFrame.onPop = onPop;
          }
          break;
        case "finish":
          stepFrame = this._getNextStepFrame(startFrame);
          if (stepFrame) {
            stepFrame.onPop = onPop;
          }
          break;
        default:
          return { error: "badParameterType",
                   message: "Unknown resumeLimit type" };
      }
    }
    if (aRequest && aRequest.pauseOnExceptions) {
      this.dbg.onExceptionUnwind = this.onExceptionUnwind.bind(this);
    }
    let packet = this._resumed();
    DebuggerServer.xpcInspector.exitNestedEventLoop();
    return packet;
  }
function TA_onResume ( aRequest ) { if ( aRequest && aRequest . forceCompletion ) { if ( typeof this . frame . pop != "function" ) { return { error : "notImplemented" , message : "forced completion is not yet implemented." } ; } this . dbg . getNewestFrame ( ) . pop ( aRequest . completionValue ) ; let packet = this . _resumed ( ) ; DebuggerServer . xpcInspector . exitNestedEventLoop ( ) ; return { type : "resumeLimit" , frameFinished : aRequest . forceCompletion } ; } if ( aRequest && aRequest . resumeLimit ) { let pauseAndRespond = this . _pauseAndRespond . bind ( this ) ; let createValueGrip = this . createValueGrip . bind ( this ) ; let startFrame = this . _youngestFrame ; let startLine ; if ( this . _youngestFrame . script ) { let offset = this . _youngestFrame . offset ; startLine = this . _youngestFrame . script . getOffsetLine ( offset ) ; } let onEnterFrame = function TA_onEnterFrame ( aFrame ) { return pauseAndRespond ( aFrame , { type : "resumeLimit" } ) ; } ; let onPop = function TA_onPop ( aCompletion ) { this . reportedPop = true ; return pauseAndRespond ( this , { type : "resumeLimit" } ) ; } let onStep = function TA_onStep ( ) { if ( this !== startFrame || ( this . script && this . script . getOffsetLine ( this . offset ) != startLine ) ) { return pauseAndRespond ( this , { type : "resumeLimit" } ) ; } return undefined ; } switch ( aRequest . resumeLimit . type ) { case "step" : this . dbg . onEnterFrame = onEnterFrame ; case "next" : let stepFrame = this . _getNextStepFrame ( startFrame ) ; if ( stepFrame ) { stepFrame . onStep = onStep ; stepFrame . onPop = onPop ; } break ; case "finish" : stepFrame = this . _getNextStepFrame ( startFrame ) ; if ( stepFrame ) { stepFrame . onPop = onPop ; } break ; default : return { error : "badParameterType" , message : "Unknown resumeLimit type" } ; } } if ( aRequest && aRequest . pauseOnExceptions ) { this . dbg . onExceptionUnwind = this . onExceptionUnwind . bind ( this ) ; } let packet = this . _resumed ( ) ; DebuggerServer . xpcInspector . exitNestedEventLoop ( ) ; return packet ; }
Handle a protocol request to resume execution of the debuggee.
Handle a protocol request to resume execution of the debuggee .
// TODO: remove this when Debugger.Frame.prototype.pop is implemented in // bug 736733. // Bind these methods because some of the hooks are called with 'this' // set to the current frame. // Define the JS hook functions for stepping. // onPop is called with 'this' set to the current frame. // Note that we're popping this frame; we need to watch for // subsequent step events on its caller. // onStep is called with 'this' set to the current frame. // If we've changed frame or line, then report that. // Otherwise, let execution continue. // Fall through.