No bug - Sort breakpoints by selected location. r=davidwalsh

Differential Revision: https://phabricator.services.mozilla.com/D23140

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jason Laster 2019-03-12 16:08:47 +00:00
Родитель c0d1b14470
Коммит 07f5ee2ca6
2 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

@ -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 &&

Просмотреть файл

@ -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