Skip to content

Commit

Permalink
core(metric): remove gatherContext mode check (#15899)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Mar 27, 2024
1 parent 3f2484d commit e3cd344
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions core/computed/metrics/lantern-metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class LanternMetric extends Metric {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
if (gatherContext.gatherMode !== 'navigation') {
if (data.gatherContext.gatherMode !== 'navigation') {
throw new Error(`Lantern metrics can only be computed on navigations`);
}

Expand Down
4 changes: 1 addition & 3 deletions core/computed/metrics/metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class Metric {
* @return {Promise<LH.Artifacts.LanternMetric|LH.Artifacts.Metric>}
*/
static async compute_(data, context) {
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
const {trace, devtoolsLog, settings} = data;
const {trace, devtoolsLog, settings, gatherContext} = data;
if (!trace || !devtoolsLog || !settings) {
throw new Error('Did not provide necessary metric computation data');
}
Expand Down

0 comments on commit e3cd344

Please sign in to comment.