Backed out changeset d0fb1493b28b (bug 1511717) for devtools failures in browser_webconsole_eval_in_debugger_stackframe.js

This commit is contained in:
Noemi Erli 2018-12-03 01:19:00 +02:00
parent c6a108cc3c
commit 142d65bfec
9 changed files with 12 additions and 57 deletions

View File

@ -14,18 +14,6 @@ import type { ThunkArgs } from "../types";
import { isGeneratedId } from "devtools-source-map";
function getSelectedFrameId(state, frames) {
if (frames.length == 0) {
return null;
}
const selectedFrame = frames.find(frame =>
!getSource(state, frame.location.sourceId).isBlackBoxed
)
return selectedFrame && selectedFrame.id
}
export function updateFrameLocation(frame: Frame, sourceMaps: any) {
if (frame.isOriginal) {
return Promise.resolve(frame);
@ -161,11 +149,9 @@ export function mapFrames() {
mappedFrames = await expandFrames(mappedFrames, sourceMaps, getState);
mappedFrames = mapDisplayNames(mappedFrames, getState);
const selectedFrameId = getSelectedFrameId(getState(), mappedFrames)
dispatch({
type: "MAP_FRAMES",
frames: mappedFrames,
selectedFrameId
frames: mappedFrames
});
};
}

View File

@ -9,9 +9,7 @@
* @module actions/sources
*/
import { isOriginalId } from "devtools-source-map";
import { recordEvent } from "../../utils/telemetry";
import { features } from "../../utils/prefs";
import { PROMISE } from "../utils/middleware/promise";
import type { Source } from "../../types";
@ -25,17 +23,10 @@ export function toggleBlackBox(source: Source) {
recordEvent("blackbox");
}
let promise;
if (features.originalBlackbox && isOriginalId(id)) {
promise = Promise.resolve({isBlackBoxed: !isBlackBoxed})
} else {
promise = client.blackBox(id, isBlackBoxed)
}
return dispatch({
type: "BLACKBOX",
source,
[PROMISE]: promise
[PROMISE]: client.blackBox(id, isBlackBoxed)
});
};
}

View File

@ -14,7 +14,7 @@ import {
getSourceLocationFromMouseEvent,
toSourceLine
} from "../../utils/editor";
import { isPretty, getRawSourceURL, shouldBlackbox } from "../../utils/source";
import { isPretty, getRawSourceURL } from "../../utils/source";
import {
getContextMenu,
getPrettySource,
@ -162,7 +162,8 @@ function getMenuItems(
id: "node-menu-blackbox",
label: toggleBlackBoxLabel,
accesskey: blackboxKey,
disabled: !shouldBlackbox(selectedSource),
disabled:
isOriginal || isPrettyPrinted || hasSourceMap || !selectedSource.url,
click: () => toggleBlackBox(selectedSource)
};

View File

@ -19,8 +19,7 @@ import {
isLoaded,
getFilename,
isOriginal,
isLoading,
shouldBlackbox
isLoading
} from "../../utils/source";
import { getGeneratedSource } from "../../reducers/sources";
import { shouldShowFooter, shouldShowPrettyPrint } from "../../utils/editor";
@ -108,7 +107,7 @@ class SourceFooter extends PureComponent<Props, State> {
const { selectedSource, toggleBlackBox } = this.props;
const sourceLoaded = selectedSource && isLoaded(selectedSource);
if (!shouldBlackbox(selectedSource)) {
if (!sourceLoaded || selectedSource.isPrettyPrinted) {
return;
}

View File

@ -13,7 +13,7 @@
import { createSelector } from "reselect";
import { isGeneratedId } from "devtools-source-map";
import { prefs } from "../utils/prefs";
import { getSelectedSource, getSource } from "./sources";
import { getSelectedSource } from "./sources";
import type { OriginalScope } from "../utils/pause/mapScopes";
import type { Action } from "../actions/types";
@ -118,11 +118,7 @@ function update(
}
case "MAP_FRAMES": {
return {
...state,
frames: action.frames,
selectedFrameId: action.selectedFrameId
};
return { ...state, frames: action.frames };
}
case "ADD_EXTRA": {

View File

@ -61,7 +61,6 @@ if (isDevelopment()) {
pref("devtools.debugger.features.map-expression-bindings", true);
pref("devtools.debugger.features.map-await-expression", true);
pref("devtools.debugger.features.xhr-breakpoints", true);
pref("devtools.debugger.features.origial-blackbox", false);
}
export const prefs = new PrefsHelper("devtools", {
@ -114,8 +113,7 @@ export const features = new PrefsHelper("devtools.debugger.features", {
mapExpressionBindings: ["Bool", "map-expression-bindings"],
mapAwaitExpression: ["Bool", "map-await-expression"],
componentPane: ["Bool", "component-pane"],
xhrBreakpoints: ["Bool", "xhr-breakpoints"],
originalBlackbox: ["Bool", "origial-blackbox"],
xhrBreakpoints: ["Bool", "xhr-breakpoints"]
});
export const asyncStore = asyncStoreHelper("debugger", {

View File

@ -19,7 +19,7 @@ import { renderWasmText } from "./wasm";
import { toEditorPosition } from "./editor";
export { isMinified } from "./isMinified";
import { getURL, getFileExtension } from "./sources-tree";
import { prefs, features } from "./prefs";
import { prefs } from "./prefs";
import type { Source, SourceLocation, JsSource } from "../types";
import type { SourceMetaDataType } from "../reducers/ast";
@ -55,22 +55,6 @@ function trimUrlQuery(url: string): string {
return url.slice(0, q);
}
export function shouldBlackbox(source: ?Source) {
if (!source) {
return false;
}
if (!isLoaded(source) || !source.url) {
return false;
}
if (isOriginalId(source.id) && !features.originalBlackbox) {
return false;
}
return true;
}
export function shouldPrettyPrint(source: Source) {
if (
!source ||

View File

@ -67,4 +67,3 @@ pref("devtools.debugger.features.skip-pausing", true);
pref("devtools.debugger.features.autocomplete-expressions", false);
pref("devtools.debugger.features.map-expression-bindings", true);
pref("devtools.debugger.features.xhr-breakpoints", true);
pref("devtools.debugger.features.origial-blackbox", false);

View File

@ -634,6 +634,7 @@
.webreplay-player .tick {
position: absolute;
height: 100%;
transition-duration: var(--progress-bar-transition);
}
.webreplay-player .tick::before,