Bug 1564243 - Don't show map scopes for pretty sources r=jlast

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-07-16 13:22:32 +00:00
Родитель 63b68be0e1
Коммит 6e8b9aea44
1 изменённых файлов: 19 добавлений и 4 удалений

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

@ -24,6 +24,7 @@ import {
getWorkers, getWorkers,
getCurrentThread, getCurrentThread,
getThreadContext, getThreadContext,
getSourceFromId,
} from "../../selectors"; } from "../../selectors";
import AccessibleImage from "../shared/AccessibleImage"; import AccessibleImage from "../shared/AccessibleImage";
@ -45,7 +46,13 @@ import Scopes from "./Scopes";
import "./SecondaryPanes.css"; import "./SecondaryPanes.css";
import type { Expression, Frame, WorkerList, ThreadContext } from "../../types"; import type {
Expression,
Frame,
WorkerList,
ThreadContext,
Source,
} from "../../types";
type AccordionPaneItem = { type AccordionPaneItem = {
header: string, header: string,
@ -88,6 +95,7 @@ type Props = {
shouldPauseOnExceptions: boolean, shouldPauseOnExceptions: boolean,
shouldPauseOnCaughtExceptions: boolean, shouldPauseOnCaughtExceptions: boolean,
workers: WorkerList, workers: WorkerList,
source: ?Source,
toggleShortcutsModal: () => void, toggleShortcutsModal: () => void,
toggleAllBreakpoints: typeof actions.toggleAllBreakpoints, toggleAllBreakpoints: typeof actions.toggleAllBreakpoints,
toggleMapScopes: typeof actions.toggleMapScopes, toggleMapScopes: typeof actions.toggleMapScopes,
@ -228,9 +236,13 @@ class SecondaryPanes extends Component<Props, State> {
} }
getScopesButtons() { getScopesButtons() {
const { selectedFrame, mapScopesEnabled } = this.props; const { selectedFrame, mapScopesEnabled, source } = this.props;
if (!selectedFrame || isGeneratedId(selectedFrame.location.sourceId)) { if (
!selectedFrame ||
isGeneratedId(selectedFrame.location.sourceId) ||
(source && source.isPrettyPrinted)
) {
return null; return null;
} }
@ -487,6 +499,7 @@ function getRenderWhyPauseDelay(state, thread) {
const mapStateToProps = state => { const mapStateToProps = state => {
const thread = getCurrentThread(state); const thread = getCurrentThread(state);
const selectedFrame = getSelectedFrame(state, thread);
return { return {
cx: getThreadContext(state), cx: getThreadContext(state),
@ -496,11 +509,13 @@ const mapStateToProps = state => {
breakpointsDisabled: getBreakpointsDisabled(state), breakpointsDisabled: getBreakpointsDisabled(state),
isWaitingOnBreak: getIsWaitingOnBreak(state, thread), isWaitingOnBreak: getIsWaitingOnBreak(state, thread),
renderWhyPauseDelay: getRenderWhyPauseDelay(state, thread), renderWhyPauseDelay: getRenderWhyPauseDelay(state, thread),
selectedFrame: getSelectedFrame(state, thread), selectedFrame,
mapScopesEnabled: isMapScopesEnabled(state), mapScopesEnabled: isMapScopesEnabled(state),
shouldPauseOnExceptions: getShouldPauseOnExceptions(state), shouldPauseOnExceptions: getShouldPauseOnExceptions(state),
shouldPauseOnCaughtExceptions: getShouldPauseOnCaughtExceptions(state), shouldPauseOnCaughtExceptions: getShouldPauseOnCaughtExceptions(state),
workers: getWorkers(state), workers: getWorkers(state),
source:
selectedFrame && getSourceFromId(state, selectedFrame.location.sourceId),
}; };
}; };