зеркало из https://github.com/mozilla/gecko-dev.git
Bug 783829 - Make PlacesUtils.nodeAncestors a new generator. r=mak
This commit is contained in:
Родитель
d398e6a3f7
Коммит
6847f14b74
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче