Skip to content

Commit

Permalink
move SDK up b/c global pollution is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 11, 2019
1 parent 47e8a41 commit 73eca7b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lighthouse-core/computed/bundle-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const log = require('lighthouse-logger');
const Audit = require('../audits/audit.js');
const NetworkRecords = require('./network-records.js');
const makeComputedArtifact = require('./computed-artifact.js');
const SDK = require('../lib/cdt/SDK.js');

/**
* @typedef {typeof import('../lib/cdt/SDK.js')['TextSourceMap']} SourceMap
* @typedef {typeof SDK.TextSourceMap} SourceMap
*/

/**
Expand Down Expand Up @@ -132,8 +133,6 @@ class BundleAnalysis {
script: scriptElement,
networkRecord,
get map() {
// Defer global pollution.
const SDK = require('../lib/cdt/SDK.js');
if (map) return map;
// @ts-ignore: TODO: `sections` needs to be in rawMap types
return map = new SDK.TextSourceMap(`compiled.js`, `compiled.js.map`, rawMap);
Expand Down

0 comments on commit 73eca7b

Please sign in to comment.