diff --git a/devtools/client/debugger/new/src/selectors/breakpointSources.js b/devtools/client/debugger/new/src/selectors/breakpointSources.js index f6354a22fb61..227ce881eb42 100644 --- a/devtools/client/debugger/new/src/selectors/breakpointSources.js +++ b/devtools/client/debugger/new/src/selectors/breakpointSources.js @@ -13,6 +13,7 @@ import { } from "../selectors"; import { getFilename } from "../utils/source"; import { getSelectedLocation } from "../utils/source-maps"; +import { sortSelectedBreakpoints } from "../utils/breakpoint"; import type { Source, Breakpoint } from "../types"; import type { Selector, SourcesMap } from "../reducers/types"; @@ -27,12 +28,7 @@ function getBreakpointsForSource( selectedSource: ?Source, breakpoints: Breakpoint[] ) { - return breakpoints - .sort( - (a, b) => - getSelectedLocation(a, selectedSource).line - - getSelectedLocation(b, selectedSource).line - ) + return sortSelectedBreakpoints(breakpoints, selectedSource) .filter( bp => !bp.options.hidden && diff --git a/devtools/client/debugger/new/src/utils/breakpoint/index.js b/devtools/client/debugger/new/src/utils/breakpoint/index.js index 44ea08d81d30..128b7fa1bae4 100644 --- a/devtools/client/debugger/new/src/utils/breakpoint/index.js +++ b/devtools/client/debugger/new/src/utils/breakpoint/index.js @@ -232,7 +232,7 @@ export function getSelectedText( export function sortSelectedBreakpoints( breakpoints: Breakpoint[], - selectedSource: Source + selectedSource: ?Source ): Breakpoint[] { return sortBy(breakpoints, [ // Priority: line number, undefined column, column number