diff --git a/polymer.html b/polymer.html index 547eaaece9..342da18383 100644 --- a/polymer.html +++ b/polymer.html @@ -42,12 +42,12 @@ this._prepEffects(); // shared behaviors this._prepBehaviors(); + // fast access to property info + this._prepPropertyInfo(); // accessors part 2 this._prepBindings(); // dom encapsulation this._prepShady(); - // fast access to property info - this._prepPropertyInfo(); }, _prepBehavior: function(b) { diff --git a/src/lib/bind/accessors.html b/src/lib/bind/accessors.html index 3f0f6a73d0..679ffae269 100644 --- a/src/lib/bind/accessors.html +++ b/src/lib/bind/accessors.html @@ -170,6 +170,8 @@ // ReadOnly properties have a private setter only // TODO(kschaaf): Per current Bind factoring, we shouldn't // be interrogating the prototype here + // TODO(sorvell): we want to avoid using `getPropertyInfo` here, but + // this requires more data in `_propertyInfo` var info = model.getPropertyInfo && model.getPropertyInfo(property); if (info && info.readOnly) { // Computed properties are read-only (no property setter), but also don't diff --git a/src/lib/template/templatizer.html b/src/lib/template/templatizer.html index 86b90fbf72..ee8ea789d9 100644 --- a/src/lib/template/templatizer.html +++ b/src/lib/template/templatizer.html @@ -116,8 +116,8 @@ archetype._prepEffects(); this._customPrepEffects(archetype); archetype._prepBehaviors(); - archetype._prepBindings(); archetype._prepPropertyInfo(); + archetype._prepBindings(); // boilerplate code archetype._notifyPathUp = this._notifyPathUpImpl; diff --git a/src/micro/properties.html b/src/micro/properties.html index dde4ad0480..60257e2c90 100644 --- a/src/micro/properties.html +++ b/src/micro/properties.html @@ -105,6 +105,9 @@ * @param {string} property Name of property to introspect. * @return {Object} Property descriptor for specified property. */ + // TODO(sorvell): This function returns the first property object found + // and this is not the property info Polymer acts on for readOnly or type + // This api should be combined with _propertyInfo. getPropertyInfo: function(property) { var info = this._getPropertyInfo(property, this.properties); if (!info) { @@ -156,8 +159,11 @@ continue; } if (!target[i]) { - target[i] = t = typeof(s) === 'function' ? {type: s} : s; - t.attribute = Polymer.CaseMap.camelToDashCase(i); + target[i] = { + type: typeof(s) === 'function' ? s : s.type, + readOnly: s.readOnly, + attribute: Polymer.CaseMap.camelToDashCase(i) + } } else { if (!t.type) { t.type = s.type; @@ -165,12 +171,6 @@ if (!t.readOnly) { t.readOnly = s.readOnly; } - if (!t.notify) { - t.notify = s.notify; - } - if (!t.readOnly) { - t.readOnly = s.readOnly; - } } } }