Bug 1441531 - Convert waitForMultipleChildrenUpdates from Task.jsm to async/await.
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 27 Feb 2018 04:18:03 -0800
changeset 760926 e17b5ac4415c90b10e99f69e9da62acdf0d426b1
parent 760185 580d833df9c44acec686a9fb88b5f27e9d29f68d
push id100774
push userbmo:poirot.alex@gmail.com
push dateWed, 28 Feb 2018 10:59:35 +0000
bugs1441531
milestone60.0a1
Bug 1441531 - Convert waitForMultipleChildrenUpdates from Task.jsm to async/await. MozReview-Commit-ID: KqZKTSrfhdL
devtools/client/inspector/test/head.js
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -528,23 +528,23 @@ const getHighlighterHelperFor = (type) =
       }
     };
   }
 );
 
 // The expand all operation of the markup-view calls itself recursively and
 // there's not one event we can wait for to know when it's done so use this
 // helper function to wait until all recursive children updates are done.
-function* waitForMultipleChildrenUpdates(inspector) {
+async function waitForMultipleChildrenUpdates(inspector) {
   // As long as child updates are queued up while we wait for an update already
   // wait again
   if (inspector.markup._queuedChildUpdates &&
         inspector.markup._queuedChildUpdates.size) {
-    yield waitForChildrenUpdated(inspector);
-    return yield waitForMultipleChildrenUpdates(inspector);
+    await waitForChildrenUpdated(inspector);
+    return await waitForMultipleChildrenUpdates(inspector);
   }
   return null;
 }
 
 /**
  * Using the markupview's _waitForChildren function, wait for all queued
  * children updates to be handled.
  * @param {InspectorPanel} inspector The instance of InspectorPanel currently