Bug 1561392 - Handle backward-compat for new event-breakpoint implementation. r=davidwalsh

Differential Revision: https://phabricator.services.mozilla.com/D35847

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Logan Smyth 2019-06-25 20:17:24 +00:00
Родитель 591aa42a3b
Коммит d0d8f42f64
1 изменённых файлов: 17 добавлений и 1 удалений

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

@ -377,7 +377,23 @@ async function setEventListenerBreakpoints(ids: string[]) {
async function getEventListenerBreakpointTypes(): Promise<
EventListenerCategoryList
> {
return threadClient.getAvailableEventBreakpoints();
let categories;
try {
categories = await threadClient.getAvailableEventBreakpoints();
if (!Array.isArray(categories)) {
// When connecting to older browser that had our placeholder
// implementation of the 'getAvailableEventBreakpoints' endpoint, we
// actually get back an object with a 'value' property containing
// the categories. Since that endpoint wasn't actually backed with a
// functional implementation, we just bail here instead of storing the
// 'value' property into the categories.
categories = null;
}
} catch (err) {
// Event bps aren't supported on this firefox version.
}
return categories || [];
}
function pauseGrip(thread: string, func: Function): ObjectClient {