Skip to content

Commit

Permalink
feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Mar 13, 2018
1 parent 5e1337d commit c2e25b5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions lighthouse-core/report/v2/renderer/report-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ReportRenderer {
// If any mutations happen to the report within the renderers, we want the original object untouched
const clone = /** @type {!ReportRenderer.ReportJSON} */ (JSON.parse(JSON.stringify(report)));

if (!Array.isArray(report.reportCategories)) throw new Error('No reportCategories provided.');
ReportRenderer.smooshAuditResultsIntoCategories(report.audits, report.reportCategories);

container.textContent = ''; // Remove previous report.
const element = container.appendChild(this._renderReport(clone));
return /** @type {!Element} **/ (element);
Expand Down Expand Up @@ -158,8 +161,6 @@ class ReportRenderer {

const categories = reportSection.appendChild(this._dom.createElement('div', 'lh-categories'));

ReportRenderer.smooshAuditResultsIntoCategories(report.audits, report.reportCategories);

for (const category of report.reportCategories) {
if (scoreHeader) {
scoreHeader.appendChild(categoryRenderer.renderScoreGauge(category));
Expand Down Expand Up @@ -198,16 +199,6 @@ if (typeof module !== 'undefined' && module.exports) {
self.ReportRenderer = ReportRenderer;
}

/**
* @typedef {{
* id: string,
* weight: number,
* group: (string|undefined),
* result: (ReportRenderer.AuditResultJSON|undefined)
* }}
*/
ReportRenderer.AuditJSON; // eslint-disable-line no-unused-expressions

/**
* @typedef {{
* rawValue: (number|boolean|undefined),
Expand Down

0 comments on commit c2e25b5

Please sign in to comment.