mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 783829 - Make PlacesUtils.nodeAncestors a new generator. r=mak
This commit is contained in:
parent
aff58df807
commit
f175058069
@ -152,7 +152,7 @@ PlacesTreeView.prototype = {
|
||||
// A node is removed form the view either if it has no parent or if its
|
||||
// root-ancestor is not the root node (in which case that's the node
|
||||
// for which nodeRemoved was called).
|
||||
let ancestors = [x for each (x in PlacesUtils.nodeAncestors(aNode))];
|
||||
let ancestors = [x for (x of PlacesUtils.nodeAncestors(aNode))];
|
||||
if (ancestors.length == 0 ||
|
||||
ancestors[ancestors.length - 1] != this._rootNode) {
|
||||
throw new Error("Removed node passed to _getRowForNode");
|
||||
@ -417,7 +417,7 @@ PlacesTreeView.prototype = {
|
||||
// However, if any of the node's ancestor is closed, the node is
|
||||
// invisible.
|
||||
let ancestors = PlacesUtils.nodeAncestors(aOldNode);
|
||||
for (let ancestor in ancestors) {
|
||||
for (let ancestor of ancestors) {
|
||||
if (!ancestor.containerOpen)
|
||||
return -1;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ this.PlacesUtils = {
|
||||
* @param aNode
|
||||
* A result node
|
||||
*/
|
||||
nodeAncestors: function PU_nodeAncestors(aNode) {
|
||||
nodeAncestors: function* PU_nodeAncestors(aNode) {
|
||||
let node = aNode.parent;
|
||||
while (node) {
|
||||
yield node;
|
||||
|
Loading…
Reference in New Issue
Block a user