author | Brindusan Cristian <cbrindusan@mozilla.com> |
Wed, 13 Mar 2019 17:58:50 +0200 | |
changeset 463825 | 226ec6ce41c41d599681ea2ecfaa10e8b68f98da |
parent 463824 | c2beaac7130578945db2e7ee33e8667791017f2d |
child 463826 | 84bc38dc1fdeb810790f1b7987df59377c027ae9 |
push id | 35698 |
push user | ncsoregi@mozilla.com |
push date | Wed, 13 Mar 2019 21:52:48 +0000 |
treeherder | mozilla-central@b8c1398f5a90 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1534772 |
milestone | 67.0a1 |
backs out | 5dc0ae1f1b48630aeee9ee07c2dcbda345ad3a2b |
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
|
--- a/devtools/client/debugger/new/src/actions/pause/commands.js +++ b/devtools/client/debugger/new/src/actions/pause/commands.js @@ -9,29 +9,25 @@ 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 async ({ dispatch, getState, client }: ThunkArgs) => { - await dispatch({ type: "SELECT_THREAD", thread }); - await dispatch(evaluateExpressions()); - }; + return { type: "SELECT_THREAD", thread }; } /** * 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,16 +59,35 @@ 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 }; @@ -152,9 +171,10 @@ 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,32 +79,52 @@ 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,16 +189,19 @@ 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",