Bug 1518661 - Part 6: Ensure that stepOut from inside onPop behaves properly. r=jlast
authorLogan Smyth <loganfsmyth@gmail.com>
Wed, 13 Feb 2019 02:31:02 +0000
changeset 458906 62f3c188b868
parent 458905 5c934ede1cfc
child 458907 266c1eee61a8
push id35551
push usershindli@mozilla.com
push dateWed, 13 Feb 2019 21:34:09 +0000
treeherdermozilla-central@08f794a4928e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1518661
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518661 - Part 6: Ensure that stepOut from inside onPop behaves properly. r=jlast The step-out logic currently has a special case to skip pausing onPop when stepping out of the current frame. This logic gets confused if you are already _in_ the onPop of the current frame though, and causes you to also fail to pause onPop in the parent frame. Differential Revision: https://phabricator.services.mozilla.com/D17663
devtools/server/actors/thread.js
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -780,30 +780,36 @@ const ThreadActor = ActorClassWithSpec(t
    * receive a resume request with a resumeLimit property.
    *
    * @param Object request
    *        The request packet received over the RDP.
    * @returns A promise that resolves to true once the hooks are attached, or is
    *          rejected with an error packet.
    */
   _handleResumeLimit: async function(request) {
-    const steppingType = request.resumeLimit.type;
+    let steppingType = request.resumeLimit.type;
     const rewinding = request.rewind;
     if (!["break", "step", "next", "finish", "warp"].includes(steppingType)) {
       return Promise.reject({
         error: "badParameterType",
         message: "Unknown resumeLimit type",
       });
     }
 
     if (steppingType == "warp") {
       // Time warp resume limits are handled by the caller.
       return true;
     }
 
+    // If we are stepping out of the onPop handler, we want to use "next" mode
+    // so that the parent frame's handlers behave consistently.
+    if (steppingType === "finish" && this.youngestFrame.reportedPop) {
+      steppingType = "next";
+    }
+
     const generatedLocation = this.sources.getFrameLocation(this.youngestFrame);
     const { onEnterFrame, onPop, onStep } = this._makeSteppingHooks(
       generatedLocation,
       steppingType,
       rewinding
     );
 
     // Make sure there is still a frame on the stack if we are to continue