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 id30159
push userryanvm@gmail.com
push dateSun, 10 Apr 2016 20:20:07 +0000
treeherdermozilla-central@9332103718ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1263140
milestone48.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 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"
 }