summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/content/statusline.js2
-rw-r--r--common/modules/base.jsm21
2 files changed, 5 insertions, 18 deletions
diff --git a/common/content/statusline.js b/common/content/statusline.js
index 34d4ce80..15aa3d78 100644
--- a/common/content/statusline.js
+++ b/common/content/statusline.js
@@ -121,8 +121,6 @@ var StatusLine = Module("statusline", {
},
cleanup: function cleanup(reason) {
- util.dump("CLEANUP " + reason);
- util.dump(this.statusBar.id, document.getElementById(this.statusBar.id));
if (reason != "unload" && "CustomizableUI" in window)
CustomizableUI.unregisterArea(this.statusBar.id, false);
},
diff --git a/common/modules/base.jsm b/common/modules/base.jsm
index 9f3ec1a0..52ea7d80 100644
--- a/common/modules/base.jsm
+++ b/common/modules/base.jsm
@@ -1405,6 +1405,7 @@ function octal(decimal) parseInt(decimal, 8);
* @param {nsIJSIID} iface The interface to which to query all elements.
* @returns {Generator}
*/
+let _iterator = "@@iterator" in [] ? "@@iterator" : "iterator";
function iter(obj, iface) {
if (arguments.length == 2 && iface instanceof Ci.nsIJSIID)
return iter(obj).map(item => item.QueryInterface(iface));
@@ -1420,20 +1421,10 @@ function iter(obj, iface) {
})();
else if (isinstance(obj, ["Iterator", "Generator"]))
;
- else if (isinstance(obj, ["Map Iterator"]))
- // This is stupid.
- res = (function () {
- for (;;) {
- let { value, done } = obj.next();
- if (done)
- return;
-
- yield value;
- }
- })();
- else if (isinstance(obj, ["Map"]))
- // This is stupid.
- res = (r for (r of obj));
+ else if (isinstance(obj, [Ci.nsIDOMHTMLCollection, Ci.nsIDOMNodeList]))
+ res = array.iterItems(obj);
+ else if (_iterator in obj && callable(obj[_iterator]) && !("__iterator__" in obj))
+ res = (x for (x of obj));
else if (ctypes && ctypes.CData && obj instanceof ctypes.CData) {
while (obj.constructor instanceof ctypes.PointerType)
obj = obj.contents;
@@ -1447,8 +1438,6 @@ function iter(obj, iface) {
else
return iter({});
}
- else if (isinstance(obj, [Ci.nsIDOMHTMLCollection, Ci.nsIDOMNodeList]))
- res = array.iterItems(obj);
else if (Ci.nsIDOMNamedNodeMap && obj instanceof Ci.nsIDOMNamedNodeMap ||
Ci.nsIDOMMozNamedAttrMap && obj instanceof Ci.nsIDOMMozNamedAttrMap)
res = (function () {