mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Add _initializeProtoProperties
as an override in PropertyAccessrs, overridden in PropertyEffects.
This commit is contained in:
parent
c7dc0fefb6
commit
eb3f26c15e
@ -77,7 +77,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
static createPropertiesForAttributes() {
|
||||
let a$ = this.observedAttributes;
|
||||
for (let i=0; i < a$.length; i++) {
|
||||
this._createPropertyAccessor(caseMap.dashToCamelCase(a$[i]));
|
||||
this.prototype._createPropertyAccessor(caseMap.dashToCamelCase(a$[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,14 +109,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
this.__dataCounter = 0;
|
||||
this.__dataInvalid = false;
|
||||
// initialize data with prototype values saved when creating accessors
|
||||
this.__data = {};
|
||||
this.__dataPending = null;
|
||||
this.__dataOld = null;
|
||||
if (this.__dataProto) {
|
||||
this.__data = Object.create(this.__dataProto);
|
||||
this.__dataPending = Object.create(this.__dataProto);
|
||||
this.__dataOld = {};
|
||||
} else {
|
||||
this.__data = {};
|
||||
this.__dataPending = null;
|
||||
this.__dataOld = null;
|
||||
this._initializeProtoProperties(this.__dataProto);
|
||||
}
|
||||
}
|
||||
|
||||
_initializeProtoProperties(props) {
|
||||
for (let p in props) {
|
||||
this._setProperty(p, props[p]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1218,6 +1218,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
}
|
||||
|
||||
_initializeProtoProperties(props) {
|
||||
this.__data = Object.create(props);
|
||||
this.__dataPending = Object.create(props);
|
||||
this.__dataOld = {};
|
||||
}
|
||||
|
||||
// Prototype setup ----------------------------------------
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user