mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Avoid stomping on property objects when mixing behaviors.
This commit is contained in:
parent
dc2255c8b3
commit
ec4d3132cd
@ -42,12 +42,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
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) {
|
||||
|
@ -170,6 +170,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
// 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
|
||||
|
@ -116,8 +116,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
archetype._prepEffects();
|
||||
this._customPrepEffects(archetype);
|
||||
archetype._prepBehaviors();
|
||||
archetype._prepBindings();
|
||||
archetype._prepPropertyInfo();
|
||||
archetype._prepBindings();
|
||||
|
||||
// boilerplate code
|
||||
archetype._notifyPathUp = this._notifyPathUpImpl;
|
||||
|
@ -105,6 +105,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @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 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
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 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
if (!t.readOnly) {
|
||||
t.readOnly = s.readOnly;
|
||||
}
|
||||
if (!t.notify) {
|
||||
t.notify = s.notify;
|
||||
}
|
||||
if (!t.readOnly) {
|
||||
t.readOnly = s.readOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user