Calling collection.reset() without arguments causes a wrong behaviour due to line 588 of query-engine.js. (QueryCollection.prototype.add). It looks the problem is the condition that forces the creation of an array when models argument is not one (:[models]). It creates an array even in the case the models argument of add method is undefined. This causes the array to have 1 phantom element ({}).
Fortunately there is an easy workaround, to call reset method with an an empty array (collection.reset([])). This way the condition that gets evaluated is ?models.slice() and that returns an empty array which is the expected behaviour.
Are you accepting pull requests? I see many issues open.
Calling
collection.reset()without arguments causes a wrong behaviour due to line 588 ofquery-engine.js.(QueryCollection.prototype.add). It looks the problem is the condition that forces the creation of an array whenmodelsargument is not one (:[models]). It creates an array even in the case themodelsargument ofaddmethod isundefined. This causes the array to have 1 phantom element ({}).Fortunately there is an easy workaround, to call
resetmethod with an an empty array (collection.reset([])). This way the condition that gets evaluated is?models.slice()and that returns an empty array which is the expected behaviour.Are you accepting pull requests? I see many issues open.