(No bug) Replace misuse of Array.some() r=kmag
authorAndrew Swan <aswan@mozilla.com>
Thu, 01 Dec 2016 14:54:47 -0800
changeset 325078 2fcb49a693ff0bc5820c88f2aaaeec2a85c56680
parent 325077 c0efbd59ccc496dae32715a9730a76d0639ffdfe
child 325079 2b930547912204ee4d32c62ae79c281dcc9a8213
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerskmag
milestone53.0a1
(No bug) Replace misuse of Array.some() r=kmag MozReview-Commit-ID: 5DpG14EcJCE
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -254,20 +254,18 @@ PopupNotifications.prototype = {
    * @param browser
    *        The browser whose notifications should be searched. If null, the
    *        currently selected browser's notifications will be searched.
    *
    * @returns the corresponding Notification object, or null if no such
    *          notification exists.
    */
   getNotification: function PopupNotifications_getNotification(id, browser) {
-    let n = null;
     let notifications = this._getNotificationsForBrowser(browser || this.tabbrowser.selectedBrowser);
-    notifications.some(x => x.id == id && (n = x));
-    return n;
+    return notifications.find(x => x.id == id) || null;
   },
 
   /**
    * Adds a new popup notification.
    * @param browser
    *        The <xul:browser> element associated with the notification. Must not
    *        be null.
    * @param id