зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1717739 - Ensure waiting for all breakpoint to be set while loading the debugger. r=nchevobbe
This will prevent these pending request during toolbox shutdown highlighted in browser_keybindings_01.js. Differential Revision: https://phabricator.services.mozilla.com/D119393
This commit is contained in:
Родитель
1d0551a941
Коммит
a8b63322a6
|
@ -21,26 +21,29 @@ import { initialSourcesState } from "./reducers/sources";
|
|||
async function syncBreakpoints() {
|
||||
const breakpoints = await asyncStore.pendingBreakpoints;
|
||||
const breakpointValues = Object.values(breakpoints);
|
||||
breakpointValues.forEach(({ disabled, options, generatedLocation }) => {
|
||||
if (!disabled) {
|
||||
firefox.clientCommands.setBreakpoint(generatedLocation, options);
|
||||
}
|
||||
});
|
||||
return Promise.all(
|
||||
breakpointValues.map(({ disabled, options, generatedLocation }) => {
|
||||
if (!disabled) {
|
||||
return firefox.clientCommands.setBreakpoint(generatedLocation, options);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function syncXHRBreakpoints() {
|
||||
asyncStore.xhrBreakpoints.then(bps => {
|
||||
bps.forEach(({ path, method, disabled }) => {
|
||||
async function syncXHRBreakpoints() {
|
||||
const breakpoints = await asyncStore.xhrBreakpoints;
|
||||
return Promise.all(
|
||||
breakpoints.map(({ path, method, disabled }) => {
|
||||
if (!disabled) {
|
||||
firefox.clientCommands.setXHRBreakpoint(path, method);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function setPauseOnExceptions() {
|
||||
const { pauseOnExceptions, pauseOnCaughtException } = prefs;
|
||||
firefox.clientCommands.pauseOnExceptions(
|
||||
return firefox.clientCommands.pauseOnExceptions(
|
||||
pauseOnExceptions,
|
||||
pauseOnCaughtException
|
||||
);
|
||||
|
@ -90,7 +93,7 @@ export async function bootstrap({
|
|||
);
|
||||
|
||||
await syncBreakpoints();
|
||||
syncXHRBreakpoints();
|
||||
await syncXHRBreakpoints();
|
||||
await setPauseOnExceptions();
|
||||
|
||||
setupHelper({
|
||||
|
|
Загрузка…
Ссылка в новой задаче