diff --git a/lighthouse-core/gather/driver.js b/lighthouse-core/gather/driver.js index 33e68f903173..693d4b1c925b 100644 --- a/lighthouse-core/gather/driver.js +++ b/lighthouse-core/gather/driver.js @@ -73,11 +73,11 @@ class Driver { if (this._networkStatusMonitor) { this._networkStatusMonitor.dispatch(event); } - if (event.params) { - this._eventEmitter.emit(event.method, event.params); - } else { - this._eventEmitter.emit(event.method); - } + + // @ts-ignore TODO(bckenny): tsc can't type event.params correctly yet, + // typing as property of union instead of narrowing from union of + // properties. See https://github.com/Microsoft/TypeScript/pull/22348. + this._eventEmitter.emit(event.method, event.params); }); }