зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619622 - Various fixes after switching processes to the TargetList r=loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D74240
This commit is contained in:
Родитель
c5c9a96e1e
Коммит
bedcba7d39
|
@ -8,6 +8,7 @@ import {
|
|||
isEvaluatingExpression,
|
||||
getSelectedFrame,
|
||||
getThreadContext,
|
||||
getIsPaused,
|
||||
} from "../../selectors";
|
||||
|
||||
import { mapFrames, fetchFrames } from ".";
|
||||
|
@ -32,6 +33,11 @@ export function paused(pauseInfo: Pause) {
|
|||
return async function({ dispatch, getState, client, sourceMaps }: ThunkArgs) {
|
||||
const { thread, frame, why } = pauseInfo;
|
||||
|
||||
// prevents redundant pauses, which is possible when we call checkIfAlreadyPaused. This can likely go away in the next set of patches , which exclusively use targetList
|
||||
if (getIsPaused(getState(), thread)) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch({ type: "PAUSED", thread, why, frame });
|
||||
|
||||
// Get a context capturing the newly paused and selected thread.
|
||||
|
|
|
@ -301,6 +301,11 @@ export function newGeneratedSources(sourceInfo: Array<GeneratedSourceData>) {
|
|||
getState,
|
||||
client,
|
||||
}: ThunkArgs): Promise<Array<Source>> => {
|
||||
// bails early for unnecessary calls to newGeneratedSources. This simplifies the reducers which still create a new state, but don't need to.
|
||||
if (sourceInfo.length == 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const resultIds = [];
|
||||
const newSourcesObj = {};
|
||||
const newSourceActors: Array<SourceActor> = [];
|
||||
|
|
|
@ -90,7 +90,8 @@ export function updateThreads() {
|
|||
const threads = await client.fetchThreads();
|
||||
validateContext(getState(), cx);
|
||||
|
||||
const currentThreads = getThreads(getState());
|
||||
// looking at all the threads includes the mainThread in the list. This will go away in the next set of patches.
|
||||
const currentThreads = getAllThreads(getState());
|
||||
|
||||
const addedThreads = differenceBy(threads, currentThreads, t => t.actor);
|
||||
const removedThreads = differenceBy(currentThreads, threads, t => t.actor);
|
||||
|
|
|
@ -54,7 +54,11 @@ export default function update(
|
|||
case "INSERT_THREADS":
|
||||
return {
|
||||
...state,
|
||||
threads: [...state.threads, ...action.threads],
|
||||
threads: [
|
||||
...state.threads,
|
||||
// This excludes the mainThread from being added in the list of threads. This change will also go away in the next set because the main thread will be in this list.
|
||||
...action.threads.filter(thread => thread.type != "mainThread"),
|
||||
],
|
||||
};
|
||||
case "REMOVE_THREADS":
|
||||
const { threads } = action;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
console.log("ran script!");
|
||||
|
||||
function noGC() {}
|
||||
|
||||
//# sourceURL=fake.js
|
||||
//# sourceMappingURL=source-pragma.js.map
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
// It is therefore quite long to run.
|
||||
|
||||
requestLongerTimeout(10);
|
||||
const { PromiseTestUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/PromiseTestUtils.jsm"
|
||||
);
|
||||
|
||||
// whitelist a context error because it is harmless. This could likely be removed in the next patch because it is a symptom of events coming from the target-list and debugger targets module...
|
||||
PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/);
|
||||
|
||||
const TEST_URL =
|
||||
"data:text/html;charset=utf-8," +
|
||||
|
|
Загрузка…
Ссылка в новой задаче