зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c0d1b14470
Коммит
07f5ee2ca6
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче