Bug 1530360 - Fix Recent flow regressions (3). r=bhackett
authorJason Laster <jlaster@mozilla.com>
Mon, 25 Feb 2019 15:42:09 +0000
changeset 518809 81b6ad81fb9c867bbdf4e240ff5e7758239f2b23
parent 518808 e67aafaf366c0c9737211830217c303b730eb696
child 518810 698edbbeb0c5ddece1e887f98ee8531fa8ab63d8
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1530360
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530360 - Fix Recent flow regressions (3). r=bhackett Differential Revision: https://phabricator.services.mozilla.com/D21017
devtools/client/debugger/new/src/reducers/sources.js
--- a/devtools/client/debugger/new/src/reducers/sources.js
+++ b/devtools/client/debugger/new/src/reducers/sources.js
@@ -229,17 +229,17 @@ function addSources(state: SourcesState,
     let updatedSource = existingSource || source;
 
     // Merge the source actor list
     if (existingSource && source.actors) {
       const actors = uniqBy(
         [...existingSource.actors, ...source.actors],
         ({ actor }) => actor
       );
-      updatedSource = { ...updatedSource, actors }
+      updatedSource = (({ ...updatedSource, actors }: any): Source);
     }
 
     // 1. Add the source to the sources map
     state.sources[source.id] = updatedSource;
 
     // 2. Update the source url map
     const existing = state.urls[source.url] || [];
     if (!existing.includes(source.id)) {
@@ -373,20 +373,20 @@ export function getSource(state: OuterSt
 export function getSourceFromId(state: OuterState, id: string): Source {
   const source = getSource(state, id);
   if (!source) {
     throw new Error(`source ${id} does not exist`);
   }
   return source;
 }
 
-export function getSourceByActorId(state: OuterState, actorId: string): Source {
+export function getSourceByActorId(state: OuterState, actorId: string): ?Source {
   // We don't index the sources by actor IDs, so this method should be used
   // sparingly.
-  for (const source of Object.values(getSources(state))) {
+  for (const source of getSourceList(state)) {
     if (source.actors.some(({ actor }) => actor == actorId)) {
       return source;
     }
   }
   return null;
 }
 
 export function getSourcesByURLInSources(