Bug 1263140 - Fix notified button name in SDK native-options module. r=mossop
authorLuca Greco <lgreco@mozilla.com>
Fri, 08 Apr 2016 14:00:52 +0200
changeset 292393 6553edb04f021b5876fb53ee2a0277aef7b2bea6
parent 292392 1af4c669349718874f6a366f3f1f52ff2f86adfc
child 292394 2677bb5bffff8ae7e02b20bb62de9822a70da1e6
push id18619
push userryanvm@gmail.com
push dateSat, 09 Apr 2016 19:51:30 +0000
treeherderfx-team@ef111ba6ddf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1263140
milestone48.0a1
Bug 1263140 - Fix notified button name in SDK native-options module. r=mossop MozReview-Commit-ID: DS6hX5SemJA
addon-sdk/source/lib/sdk/preferences/native-options.js
addon-sdk/source/test/addons/simple-prefs/package.json
--- a/addon-sdk/source/lib/sdk/preferences/native-options.js
+++ b/addon-sdk/source/lib/sdk/preferences/native-options.js
@@ -128,19 +128,19 @@ function setDefaults(preferences, prefer
 }
 exports.setDefaults = setDefaults;
 
 // dynamically injects inline options into about:addons page at runtime
 // NOTE: on Firefox Desktop the about:addons page is a xul page document,
 // on Firefox for Android the about:addons page is an xhtml page, to support both
 // the XUL xml namespace have to be enforced.
 function injectOptions({ preferences, preferencesBranch, document, parent, id }) {
-  for (let { name, type, hidden, title, description, label, options, on, off } of preferences) {
+  preferences.forEach(({name, type, hidden, title, description, label, options, on, off}) => {
     if (hidden) {
-      continue;
+      return;
     }
 
     let setting = document.createElementNS(XUL_NS, 'setting');
     setting.setAttribute('pref-name', name);
     setting.setAttribute('data-jetpack-id', id);
     setting.setAttribute('pref', 'extensions.' + preferencesBranch + '.' + name);
     setting.setAttribute('type', type);
     setting.setAttribute('title', title);
@@ -183,11 +183,11 @@ function injectOptions({ preferences, pr
         radio.setAttribute('value', value);
         radio.setAttribute('label', label);
         radiogroup.appendChild(radio);
       }
       setting.appendChild(radiogroup);
     }
 
     parent.appendChild(setting);
-  }
+  });
 }
 exports.injectOptions = injectOptions;
--- a/addon-sdk/source/test/addons/simple-prefs/package.json
+++ b/addon-sdk/source/test/addons/simple-prefs/package.json
@@ -10,23 +10,23 @@
   {
     "description": "How many of them we have.",
     "name": "myInteger",
     "type": "integer",
     "value": 8,
     "title": "my-int"
   },
   {
+    "name": "sayHello",
+    "type": "control",
+    "label": "Click me!",
+    "title": "hello"
+  },
+  {
     "name": "myHiddenInt",
     "type": "integer",
     "hidden": true,
     "value": 5,
     "title": "hidden-int"
-  },
-  {
-    "name": "sayHello",
-    "type": "control",
-    "label": "Click me!",
-    "title": "hello"
   }],
   "main": "./lib/main.js",
   "version": "0.0.1"
 }