expose the constraint count so that code can know that a query is going to end
authorAndrew Sutherland <asutherland@asutherland.org>
Mon, 06 Oct 2008 13:45:32 -0700
changeset 956 6aecee406c684fe17fadba4794cf0fac922cbd7b
parent 955 cc31b4657f0b670eb48628fca09e523981197ea9
child 957 c7cc67e37b99617ae7888b0acf93aa17e09cce9c
push idunknown
push userunknown
push dateunknown
expose the constraint count so that code can know that a query is going to end up being catch-all...
modules/query.js
--- a/modules/query.js
+++ b/modules/query.js
@@ -65,16 +65,20 @@ function GlodaQueryClass() {
   this._constraints = [];
   // the other instances we union with
   this._unions = [];
 }
 
 GlodaQueryClass.prototype = {
   WILDCARD: {},
   
+  get constraintCount() {
+    return this._constraints.length;
+  },
+  
   or: function gloda_query_or() {
     let owner = this._owner || this;
     let orQuery = new this._queryClass();
     orQuery._owner = owner;
     owner._unions.push(orQuery);
     return orQuery;
   },