-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
At first glance I assumed that the Query class was supposed to be immutable -- each method creates a new query instance, copies all of the properties from the previous instance and then returns it.
However, I noticed that for methods that can be called multiple times (filter() and order()) it holds a reference to the previous instance.
e.g.
var query1 = new Query(['kind1']);
var query2 = query1.filter('count >', 5);
query1.filters.length; // => 1Is this the desired functionality?
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.