Don't use for..in or for each..in loops
This improves resilience against other code modifying Array.prototype.
Fixes original issue in #48
Jonas Kümmerlin
9 years ago
771 | 771 |
}, this._rootItemDisconnectHandlers)
|
772 | 772 |
|
773 | 773 |
// fill the menu for the first time
|
774 | |
for each(let child in this._rootItem.get_children())
|
|
774 |
this._rootItem.get_children().forEach(function(child) {
|
775 | 775 |
this._rootMenu.addMenuItem(MenuItemFactory.createItem(this, child))
|
|
776 |
}, this)
|
776 | 777 |
},
|
777 | 778 |
|
778 | 779 |
_setOpenedSubmenu: function(submenu) {
|
283 | 283 |
// build up the dictionary we feed into the variant later
|
284 | 284 |
let changed = {}
|
285 | 285 |
|
286 | |
for each(let i in result) {
|
|
286 |
result.forEach(function(i) {
|
287 | 287 |
changed[i.name] = i.value
|
288 | 288 |
|
289 | 289 |
proxy.set_cached_property(i.name, i.value)
|
290 | |
}
|
|
290 |
})
|
291 | 291 |
|
292 | 292 |
// avoid any form of recursion
|
293 | 293 |
GLib.idle_add(GLib.PRIORITY_DEFAULT, proxy.emit.bind(proxy, "g-properties-changed", new GLib.Variant("a{sv}", changed), []))
|