Bug 1382340 - Fix search in about:telemetry r=chutten
authorflyingrub <flyinggrub@gmail.com>
Wed, 19 Jul 2017 21:32:48 +0200
changeset 418866 fec3b51a474ce462b9ea8d358afc8e7b7fd1270c
parent 418865 e999e5ea1f78dd6f89ae485c199477083b369946
child 418867 2c98845cb6d5dd69dbb5558ece3b710ab39bc207
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1382340, 1378759
milestone56.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 1382340 - Fix search in about:telemetry r=chutten Introducing a destructuring assignement in the Bug 1378759 caused the search throw an exception. The code was tested only in certain circumstances where the bug wasn't triggered. MozReview-Commit-ID: EWkKJhxMIuy
toolkit/content/aboutTelemetry.js
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1388,33 +1388,31 @@ var Search = {
       try {
         filter = RegExp(r[1], r[2]);
       } catch (e) { // Incomplete or bad RegExp - always no match
         isPassFunc = function() {
           return false;
         };
       }
     }
-    return {filter, isPassFunc}
+    return [isPassFunc, filter]
   },
 
   filterElements(elements, filterText) {
     let [isPassFunc, filter] = this.chooseFilter(filterText);
 
     let needLowerCase = (isPassFunc === this.isPassText);
     for (let element of elements) {
       let subject = needLowerCase ? element.id.toLowerCase() : element.id;
       element.hidden = !isPassFunc(subject, filter);
     }
   },
 
   filterKeyedElements(keyedElements, filterText) {
-    let res = this.chooseFilter(filterText);
-    let isPassFunc = res.isPassFunc;
-    let filter = res.filter;
+    let [isPassFunc, filter] = this.chooseFilter(filterText);
 
     let needLowerCase = (isPassFunc === this.isPassText);
     keyedElements.forEach((keyedElement) => {
       let subject = needLowerCase ? keyedElement.key.id.toLowerCase() : keyedElement.key.id;
       if (!isPassFunc(subject, filter)) { // If the keyedHistogram's name is not matched
         let allElementHidden = true;
         for (let element of keyedElement.datas) {
           let subject = needLowerCase ? element.id.toLowerCase() : element.id;