File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ import * as LH from '../../types/lh.js';
1919 */
2020class TraceEngineResult {
2121 /**
22- * @param {LH.TraceEvent[] } traceEvents
22+ * @param {LH.TraceEvent[] } _traceEvents
2323 * @param {LH.Audit.Context['settings'] } settings
2424 * @param {LH.Artifacts['SourceMaps'] } SourceMaps
2525 * @return {Promise<LH.Artifacts.TraceEngineResult> }
2626 */
27- static async runTraceEngine ( traceEvents , settings , SourceMaps ) {
27+ static async runTraceEngine ( _traceEvents , settings , SourceMaps ) {
2828 const processor = new TraceEngine . TraceProcessor ( TraceEngine . TraceHandlers ) ;
29+ const traceEvents =
30+ /** @type {import('@paulirish/trace_engine').Types.Events.Event[] } */ ( _traceEvents ) ;
2931
3032 const lanternSettings = { } ;
3133 if ( settings . throttlingMethod ) lanternSettings . throttlingMethod = settings . throttlingMethod ;
@@ -34,9 +36,10 @@ class TraceEngineResult {
3436 lanternSettings . precomputedLanternData = settings . precomputedLanternData ;
3537 }
3638
37- await processor . parse ( /** @type {import('@paulirish/trace_engine').Types.Events.Event[] } */ (
38- traceEvents
39- ) , {
39+ // SyntheticEventsManager must be initialized prior to processor.parse().
40+ TraceEngine . Helpers . SyntheticEvents . SyntheticEventsManager . createAndActivate ( traceEvents ) ;
41+
42+ await processor . parse ( traceEvents , {
4043 logger : {
4144 start ( id ) {
4245 const logId = `lh:computed:TraceEngineResult:${ id } ` ;
Original file line number Diff line number Diff line change @@ -11,9 +11,11 @@ polyfillDOMRect();
1111const TraceProcessor = TraceEngine . Processor . TraceProcessor ;
1212const TraceHandlers = TraceEngine . Handlers . ModelHandlers ;
1313const Insights = TraceEngine . Insights ;
14+ const Helpers = TraceEngine . Helpers ;
1415
1516export {
1617 TraceProcessor ,
1718 TraceHandlers ,
1819 Insights ,
20+ Helpers ,
1921} ;
You can’t perform that action at this time.
0 commit comments