From bd00bc404cfcb605fe49a94d1b410e3fca1a2dc6 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Sat, 3 Dec 2016 21:38:27 -0500 Subject: [PATCH] Make Collection#set/delete return the result of the super call, and clean up equals docs --- src/util/Collection.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/Collection.js b/src/util/Collection.js index 55e2f8dcb..2b6ba1537 100644 --- a/src/util/Collection.js +++ b/src/util/Collection.js @@ -23,15 +23,15 @@ class Collection extends Map { } set(key, val) { - super.set(key, val); this._array = null; this._keyArray = null; + return super.set(key, val); } delete(key) { - super.delete(key); this._array = null; this._keyArray = null; + return super.delete(key); } /** @@ -331,11 +331,11 @@ class Collection extends Map { } /** - * Returns true if the collections have identical key-value pairings. + * Checks if this collection shares identical key-value pairings with another. * This is different to checking for equality using equal-signs, because - * the collections may be different objects, but functionally identical. - * @param {Collection} collection Collection to compare with. - * @returns {boolean} + * the collections may be different objects, but contain the same data. + * @param {Collection} collection Collection to compare with + * @returns {boolean} Whether the collections have identical contents */ equals(collection) { if (this === collection) return true;