Backed out changeset f057b78337e7 (bug 1544436) for debugger failures on addToTree.js CLOSED TREE

This commit is contained in:
Cosmin Sabou 2019-04-15 20:46:25 +03:00
Родитель 483376aa8e
Коммит c433060f20
5 изменённых файлов: 14 добавлений и 6 удалений

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

@ -7,6 +7,7 @@ import {
getHiddenBreakpoint,
isEvaluatingExpression,
getSelectedFrame,
wasStepping,
getThreadContext
} from "../../selectors";
@ -14,6 +15,7 @@ import { mapFrames } from ".";
import { removeBreakpoint } from "../breakpoints";
import { evaluateExpressions } from "../expressions";
import { selectLocation } from "../sources";
import { togglePaneCollapse } from "../ui";
import assert from "../../utils/assert";
import { fetchScopes } from "./fetchScopes";
@ -58,6 +60,10 @@ export function paused(pauseInfo: Pause) {
await dispatch(selectLocation(cx, selectedFrame.location));
}
if (!wasStepping(getState(), thread)) {
dispatch(togglePaneCollapse("end", false));
}
await dispatch(fetchScopes(cx));
// Run after fetching scoping data so that it may make use of the sourcemap

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

@ -157,7 +157,8 @@ function addSourceToNode(
export function addToTree(
tree: TreeDirectory,
source: Source,
debuggeeHost: ?string
debuggeeHost: ?string,
projectRoot: string
) {
const url = getURL(source, debuggeeHost);

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

@ -14,16 +14,17 @@ import type { TreeDirectory } from "./types";
type Params = {
sources: SourcesMap,
debuggeeUrl: string
debuggeeUrl: string,
projectRoot: string
};
export function createTree({ sources, debuggeeUrl }: Params) {
export function createTree({ sources, debuggeeUrl, projectRoot }: Params) {
const uncollapsedTree = createDirectoryNode("root", "", []);
const debuggeeHost = getDomain(debuggeeUrl);
for (const sourceId in sources) {
const source = sources[sourceId];
addToTree(uncollapsedTree, source, debuggeeHost);
addToTree(uncollapsedTree, source, debuggeeHost, projectRoot);
}
const sourceTree = collapseTree((uncollapsedTree: TreeDirectory));

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

@ -106,7 +106,6 @@ describe("sources-tree", () => {
const tree = createDirectoryNode("root", "", []);
addToTree(tree, source1, "http://example.com/", "");
console.log(formatTree(tree));
expect(formatTree(tree)).toMatchSnapshot();
});

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

@ -34,6 +34,7 @@ export function updateTree({
newSources,
prevSources,
debuggeeUrl,
projectRoot,
uncollapsedTree,
sourceTree
}: Params) {
@ -41,7 +42,7 @@ export function updateTree({
const debuggeeHost = getDomain(debuggeeUrl);
for (const source of newSet) {
addToTree(uncollapsedTree, source, debuggeeHost);
addToTree(uncollapsedTree, source, debuggeeHost, projectRoot);
}
const newSourceTree = collapseTree(uncollapsedTree);