resumed.js (1063B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 import { 6 isStepping, 7 getPauseReason, 8 getSelectedFrame, 9 } from "../../selectors/index"; 10 import { evaluateExpressions } from "../expressions"; 11 import { inDebuggerEval } from "../../utils/pause/index"; 12 13 /** 14 * Debugger has just resumed. 15 */ 16 export function resumed(thread) { 17 return async ({ dispatch, getState }) => { 18 const why = getPauseReason(getState(), thread); 19 const wasPausedInEval = inDebuggerEval(why); 20 const wasStepping = isStepping(getState(), thread); 21 22 dispatch({ type: "RESUME", thread, wasStepping }); 23 24 // Avoid updating expression if we are stepping and would re-pause right after, 25 // the expression will be updated on next pause. 26 if (!wasStepping && !wasPausedInEval) { 27 const selectedFrame = getSelectedFrame(getState(), thread); 28 await dispatch(evaluateExpressions(selectedFrame)); 29 } 30 }; 31 }