Bug 1533417 - Update selected location when selecting a new thread, r=jlast.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 12 Mar 2019 10:26:02 -1000
changeset 521834 9b16f651358b
parent 521833 40e72c7f3223
child 521835 71aaa0c1b7d8
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1533417
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 1533417 - Update selected location when selecting a new thread, r=jlast.
devtools/client/debugger/new/src/actions/pause/commands.js
--- a/devtools/client/debugger/new/src/actions/pause/commands.js
+++ b/devtools/client/debugger/new/src/actions/pause/commands.js
@@ -4,33 +4,40 @@
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
 import {
   getIsPaused,
   getCurrentThread,
   getSource,
-  getTopFrame
+  getTopFrame,
+  getSelectedFrame
 } from "../../selectors";
 import { PROMISE } from "../utils/middleware/promise";
 import { getNextStep } from "../../workers/parser";
 import { addHiddenBreakpoint } from "../breakpoints";
 import { evaluateExpressions } from "../expressions";
+import { selectLocation } from "../sources";
 import { features } from "../../utils/prefs";
 import { recordEvent } from "../../utils/telemetry";
 
 import type { Source, ThreadId } from "../../types";
 import type { ThunkArgs } from "../types";
 import type { Command } from "../../reducers/types";
 
 export function selectThread(thread: ThreadId) {
   return async ({ dispatch, getState, client }: ThunkArgs) => {
     await dispatch({ type: "SELECT_THREAD", thread });
     dispatch(evaluateExpressions());
+
+    const frame = getSelectedFrame(getState(), thread);
+    if (frame) {
+      dispatch(selectLocation(frame.location));
+    }
   };
 }
 
 /**
  * Debugger commands like stepOver, stepIn, stepUp
  *
  * @param string $0.type
  * @memberof actions/pause