mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Sync memoized properties getter with 3.x version.
This commit is contained in:
@@ -93,8 +93,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) {
|
||||
let props = null;
|
||||
|
||||
if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor)) && constructor.properties) {
|
||||
props = normalizeProperties(constructor.properties);
|
||||
if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor))) {
|
||||
const properties = constructor.properties;
|
||||
|
||||
if (properties) {
|
||||
props = normalizeProperties(properties);
|
||||
}
|
||||
}
|
||||
|
||||
constructor.__ownProperties = props;
|
||||
@@ -117,9 +121,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do
|
||||
*/
|
||||
static get observedAttributes() {
|
||||
Polymer.telemetry.register(this.prototype);
|
||||
const props = this._properties;
|
||||
return props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];
|
||||
if (!this.hasOwnProperty('__observedAttributes')) {
|
||||
Polymer.telemetry.register(this.prototype);
|
||||
const props = this._properties;
|
||||
this.__observedAttributes = props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];
|
||||
}
|
||||
return this.__observedAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user