Return array instead of iterator for Collection.getChildCollections(true)
This commit is contained in:
parent
9e6a2d2e50
commit
10ca05e22e
2 changed files with 2 additions and 2 deletions
|
@ -203,7 +203,7 @@ Zotero.Collection.prototype.getChildCollections = function (asIDs) {
|
|||
|
||||
// Return collectionIDs
|
||||
if (asIDs) {
|
||||
return this._childCollections.values();
|
||||
return [...this._childCollections.values()];
|
||||
}
|
||||
|
||||
// Return Zotero.Collection objects
|
||||
|
|
|
@ -1196,7 +1196,7 @@ describe("Zotero.Translate", function() {
|
|||
assert.isNumber(translation.newCollections[0].id);
|
||||
assert.lengthOf(translation.newItems, 1);
|
||||
assert.isNumber(translation.newItems[0].id);
|
||||
var childCollections = Array.from(collection.getChildCollections(true));
|
||||
var childCollections = collection.getChildCollections(true);
|
||||
assert.sameMembers(childCollections, translation.newCollections.map(c => c.id));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue