Bug 1530985 - Make Quantum Bar controller notifications optional. r=Standard8
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 01 Mar 2019 12:36:14 +0000
changeset 519826 60359928dd2c120116d475b2d3b411284a65cc93
parent 519825 45c838c4137d1dcc65ac07dd893c313f5831b283
child 519827 513ac146d20192afc26d01dacaec1986f3e23b88
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)
reviewersStandard8
bugs1530985
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 1530985 - Make Quantum Bar controller notifications optional. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D21543
browser/components/urlbar/UrlbarController.jsm
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -452,16 +452,19 @@ class UrlbarController {
   /**
    * Internal function to notify listeners of results.
    *
    * @param {string} name Name of the notification.
    * @param {object} params Parameters to pass with the notification.
    */
   _notify(name, ...params) {
     for (let listener of this._listeners) {
-      try {
-        listener[name](...params);
-      } catch (ex) {
-        Cu.reportError(ex);
+      // Can't use "in" because some tests proxify these.
+      if (typeof listener[name] != "undefined") {
+        try {
+          listener[name](...params);
+        } catch (ex) {
+          Cu.reportError(ex);
+        }
       }
     }
   }
 }