move _boundName to boundName to avoid gloda.js having to pierce internals as
authorAndrew Sutherland <asutherland@asutherland.org>
Tue, 07 Oct 2008 01:59:39 -0700
changeset 963 e0ac27addd7e653f317606dfd7b3b3610c382d77
parent 962 13ac6cccfdc6cd4f06878009e43095568d1d4cf1
child 964 1774948ec59e8cf751fc42671021feeed08a65d9
push idunknown
push userunknown
push dateunknown
move _boundName to boundName to avoid gloda.js having to pierce internals as much (per dmose), lose the getter and what not since a transparent getter / setter is silly and can be re-introduced as needed.
modules/datamodel.js
modules/gloda.js
--- a/modules/datamodel.js
+++ b/modules/datamodel.js
@@ -61,17 +61,17 @@ function GlodaAttributeDef(aDatastore, a
   this._provider = aProvider;
   this._attrType = aAttrType;
   this._pluginName = aPluginName;
   this._attrName = aAttrName;
   this._subjectTypes = aSubjectTypes;
   this._objectType = aObjectType;
   this._objectNounMeta = aObjectNounMeta;
 
-  this._boundName = null;
+  this.boundName = null;
   this._singular = null;
 
   this._special = 0; // not special
   this._specialColumnName = null;
 
   /** Map parameter values to the underlying database id. */
   this._parameterBindings = {};
 }
@@ -79,18 +79,17 @@ function GlodaAttributeDef(aDatastore, a
 GlodaAttributeDef.prototype = {
   get id() { return this._id; },
   get provider() { return this._provider; },
   get attributeName() { return this._attrName; },
 
   get objectNoun() { return this._objectType; },
   get objectNounMeta() { return this._objectNounMeta; },
 
-  get isBound() { return this._boundName !== null; },
-  get boundName() { return this._boundName; },
+  get isBound() { return this.boundName !== null; },
   get singular() { return this._singular; },
 
   get special() { return this._special; },
   get specialColumnName() { return this._specialColumnName; },
   
   get parameterBindings() { return this._parameterBindings; },
 
   /**
@@ -120,18 +119,18 @@ GlodaAttributeDef.prototype = {
    *  of the attribute.  This handles bound and un-bound attributes.  For
    *  singular attributes, the value is null or the value; for non-singular
    *  attributes the value is a list.
    */
   getValueFromInstance: function gloda_attr_getValueFromInstance(aObj) {
     // if it's bound, we can just use the binding and trigger his caching
     // if it's special, the attribute actually exists, but just with explicit
     //  code backing it.
-    if (this._boundName !== null || this._special) {
-      return aObj[this._boundName];
+    if (this.boundName !== null || this._special) {
+      return aObj[this.boundName];
     }
     let instances = aObj.getAttributeInstances(this);
     let nounMeta = this._objectNounMeta;
     if (this._singular) {
       if (instances.length > 0)
         return nounMeta.fromParamAndValue(instances[0][1], instances[0][2]);
       else
         return null;
--- a/modules/gloda.js
+++ b/modules/gloda.js
@@ -942,17 +942,17 @@ var Gloda = {
 
       let subjectProto = subjectNounMeta.class.prototype;
       subjectProto.__defineGetter__(aBindName, getter);
       // no setters for now; manipulation comes later, and will require the attr
       //  definer to provide the actual logic, since we need to affect reality,
       //  not just the data-store.  we may also just punt that all off onto
       //  STEEL...
 
-      aAttr._boundName = aBindName;
+      aAttr.boundName = aBindName;
     }
 
     // -- the query constraint helpers
     if (subjectNounMeta.queryClass !== undefined) {
       let constrainer = function() {
         // all the arguments provided end up being ORed together
         let our_ors = [];
         for (let iArg = 0; iArg < arguments.length; iArg++) {