No bug - Ensure preview displays on paused column breakpoint lines r=jlast
authorDavid Walsh <davidwalsh83@gmail.com>
Fri, 15 Mar 2019 22:17:08 +0000
changeset 525355 32692d29ff2111e5350788ca495f05eb42ce19ad
parent 525354 26192d9f0bca0af790fb4c7f4edbf1fcb0e02f31
child 525356 744254ed3a22928784786901758382670402a0a2
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
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
No bug - Ensure preview displays on paused column breakpoint lines r=jlast TODO: Don't use the alias function and import getBreakpointsList from all used locations (many) Differential Revision: https://phabricator.services.mozilla.com/D23600
devtools/client/debugger/new/src/reducers/breakpoints.js
devtools/client/debugger/new/src/selectors/breakpoints.js
--- a/devtools/client/debugger/new/src/reducers/breakpoints.js
+++ b/devtools/client/debugger/new/src/reducers/breakpoints.js
@@ -10,16 +10,19 @@
  */
 
 import { isGeneratedId, isOriginalId } from "devtools-source-map";
 import { isEqual } from "lodash";
 
 import { makeBreakpointId } from "../utils/breakpoint";
 import { findEmptyLines } from "../utils/empty-lines";
 
+// eslint-disable-next-line max-len
+import { getBreakpointsList as getBreakpointsListSelector } from "../selectors/breakpoints";
+
 import type {
   XHRBreakpoint,
   Breakpoint,
   BreakpointId,
   SourceLocation,
   BreakpointPositions
 } from "../types";
 import type { Action, DonePromiseAction } from "../actions/types";
@@ -288,17 +291,17 @@ function isMatchingLocation(location1, l
 
 type OuterState = { breakpoints: BreakpointsState };
 
 export function getBreakpointsMap(state: OuterState): BreakpointsMap {
   return state.breakpoints.breakpoints;
 }
 
 export function getBreakpointsList(state: OuterState): Breakpoint[] {
-  return (Object.values(getBreakpointsMap(state)): any);
+  return getBreakpointsListSelector((state: any));
 }
 
 export function getBreakpointCount(state: OuterState): number {
   return getBreakpointsList(state).length;
 }
 
 export function getBreakpoint(
   state: OuterState,
--- a/devtools/client/debugger/new/src/selectors/breakpoints.js
+++ b/devtools/client/debugger/new/src/selectors/breakpoints.js
@@ -6,16 +6,17 @@
 
 import { createSelector } from "reselect";
 
 import type {
   BreakpointsState,
   XHRBreakpointsList
 } from "../reducers/breakpoints";
 import type { Selector } from "../reducers/types";
+import type { Breakpoint } from "../types";
 
 type OuterState = { breakpoints: BreakpointsState };
 
 export function getXHRBreakpoints(state: OuterState): XHRBreakpointsList {
   return state.breakpoints.xhrBreakpoints;
 }
 
 export const shouldPauseOnAnyXHR: Selector<boolean> = createSelector(
@@ -24,8 +25,13 @@ export const shouldPauseOnAnyXHR: Select
     const emptyBp = xhrBreakpoints.find(({ path }) => path.length === 0);
     if (!emptyBp) {
       return false;
     }
 
     return !emptyBp.disabled;
   }
 );
+
+export const getBreakpointsList: Selector<Breakpoint[]> = createSelector(
+  (state: OuterState) => state.breakpoints.breakpoints,
+  breakpoints => (Object.values(breakpoints): any)
+);