Alternatively you could use something like [tree-reduce](https://github.com/Gozala/tree-reduce)

```js
let tree = tree(root,
                      $ => $.type !== $.RESULT_TYPE_FOLDER,
                      $ => $.QueryInterface(Ci.nsINavHistoryContainerResultNode)
let items = reduce((items, item) =>  items.concat(item), [], tree)
```

Let's get back to this once we'll revisit tree subject again, for now I'd just rename this to `collect` as suggested above.