Skip to content

Commit

Permalink
Sync memoized properties getter with 3.x version.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Nov 7, 2018
1 parent 9d33ecb commit b3568bb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/mixins/properties-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@
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;
Expand All @@ -117,9 +121,12 @@
* @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;
}

/**
Expand Down

0 comments on commit b3568bb

Please sign in to comment.