Bug 1534772 - Evaluate expressions when selecting new threads, r=jlast.
☠☠ backed out by 226ec6ce41c4 ☠ ☠
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 13 Mar 2019 12:48:30 +0000
changeset 524712 5dc0ae1f1b48630aeee9ee07c2dcbda345ad3a2b
parent 524711 492c2ba4953f52eaa00b35fdf35312f89eceb18f
child 524713 69f7e56e68bc94a682265731fd503a58597c6be5
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1534772
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 1534772 - Evaluate expressions when selecting new threads, r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D23211
devtools/client/debugger/new/src/actions/pause/commands.js
devtools/client/debugger/new/src/actions/types/index.js
devtools/client/debugger/new/src/reducers/expressions.js
devtools/client/debugger/new/src/reducers/pause.js
--- a/devtools/client/debugger/new/src/actions/pause/commands.js
+++ b/devtools/client/debugger/new/src/actions/pause/commands.js
@@ -9,25 +9,29 @@ import {
   isPaused,
   getCurrentThread,
   getSource,
   getTopFrame
 } from "../../selectors";
 import { PROMISE } from "../utils/middleware/promise";
 import { getNextStep } from "../../workers/parser";
 import { addHiddenBreakpoint } from "../breakpoints";
+import { evaluateExpressions } from "../expressions";
 import { features } from "../../utils/prefs";
 import { recordEvent } from "../../utils/telemetry";
 
 import type { Source } from "../../types";
 import type { ThunkArgs } from "../types";
 import type { Command } from "../../reducers/types";
 
 export function selectThread(thread: string) {
-  return { type: "SELECT_THREAD", thread };
+  return async ({ dispatch, getState, client }: ThunkArgs) => {
+    await dispatch({ type: "SELECT_THREAD", thread });
+    await dispatch(evaluateExpressions());
+  };
 }
 
 /**
  * Debugger commands like stepOver, stepIn, stepUp
  *
  * @param string $0.type
  * @memberof actions/pause
  * @static
--- a/devtools/client/debugger/new/src/actions/types/index.js
+++ b/devtools/client/debugger/new/src/actions/types/index.js
@@ -59,35 +59,16 @@ type AddTabAction = {|
 type UpdateTabAction = {|
   +type: "UPDATE_TAB",
   +url: string,
   +framework?: string,
   +isOriginal?: boolean,
   +sourceId?: string
 |};
 
-type ReplayAction =
-  | {|
-      +type: "TRAVEL_TO",
-      +data: {
-        paused: {
-          why: Why,
-          scopes: Scope[],
-          frames: Frame[],
-          selectedFrameId: string,
-          loadedObjects: Object
-        },
-        expressions?: Object[]
-      },
-      +position: number
-    |}
-  | {|
-      +type: "CLEAR_HISTORY"
-    |};
-
 type NavigateAction =
   | {| +type: "CONNECT", +mainThread: MainThread, +canRewind: boolean |}
   | {| +type: "NAVIGATE", +mainThread: MainThread |};
 
 export type FocusItem = {
   thread: string,
   item: TreeNode
 };
@@ -171,10 +152,9 @@ export type Action =
   | PauseAction
   | NavigateAction
   | UIAction
   | ASTAction
   | QuickOpenAction
   | FileTextSearchAction
   | ProjectTextSearchAction
   | DebugeeAction
-  | ReplayAction
   | SourceTreeAction;
--- a/devtools/client/debugger/new/src/reducers/expressions.js
+++ b/devtools/client/debugger/new/src/reducers/expressions.js
@@ -79,52 +79,32 @@ function update(
       );
 
     case "DELETE_EXPRESSION":
       return deleteExpression(state, action.input);
 
     case "CLEAR_EXPRESSION_ERROR":
       return state.set("expressionError", false);
 
-    // respond to time travel
-    case "TRAVEL_TO":
-      return travelTo(state, action);
-
     case "AUTOCOMPLETE":
       const { matchProp, matches } = action.result;
 
       return state
         .updateIn(["autocompleteMatches", matchProp], list => matches)
         .set("currentAutocompleteInput", matchProp);
 
     case "CLEAR_AUTOCOMPLETE":
       return state
         .updateIn(["autocompleteMatches", ""], list => [])
         .set("currentAutocompleteInput", "");
   }
 
   return state;
 }
 
-function travelTo(state, action) {
-  const { expressions } = action.data;
-  if (!expressions) {
-    return state;
-  }
-  return expressions.reduce(
-    (finalState, previousState) =>
-      updateExpressionInList(finalState, previousState.input, {
-        input: previousState.input,
-        value: previousState.value,
-        updating: false
-      }),
-    state
-  );
-}
-
 function restoreExpressions() {
   const exprs = prefs.expressions;
   if (exprs.length == 0) {
     return;
   }
   return exprs;
 }
 
--- a/devtools/client/debugger/new/src/reducers/pause.js
+++ b/devtools/client/debugger/new/src/reducers/pause.js
@@ -189,19 +189,16 @@ function update(
       return updateThreadState({
         frameScopes: {
           ...threadState().frameScopes,
           generated
         }
       });
     }
 
-    case "TRAVEL_TO":
-      return updateThreadState({ ...action.data.paused });
-
     case "MAP_SCOPES": {
       const { frame, status, value } = action;
       const selectedFrameId = frame.id;
 
       const original = {
         ...threadState().frameScopes.original,
         [selectedFrameId]: {
           pending: status !== "done",