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