Bug 1148893 - Replace .then handlers with yields to catch 'Unknown sheet source' rejections in Style Editor onShow task. r=ejpbruel

This commit is contained in:
Sami Jaktholm 2015-03-28 10:15:29 +02:00
Родитель 63f9ca53ff
Коммит cd332ecd32
1 изменённых файлов: 22 добавлений и 23 удалений

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

@ -550,13 +550,14 @@ StyleEditorUI.prototype = {
this.emit("editor-selected", editor);
// Is there any CSS coverage markup to include?
csscoverage.getUsage(this._target).then(usage => {
let usage = yield csscoverage.getUsage(this._target);
if (usage == null) {
return;
}
let href = csscoverage.sheetToUrl(editor.styleSheet);
usage.createEditorReport(href).then(data => {
let data = yield usage.createEditorReport(href)
editor.removeAllUnusedRegions();
if (data.reports.length > 0) {
@ -572,8 +573,6 @@ StyleEditorUI.prototype = {
this.emit("error", { key: "error-compressed", level: "info" });
}
}
}, Cu.reportError);
}, Cu.reportError);
}.bind(this)).then(null, Cu.reportError);
}.bind(this)
});