Skip to content

Commit b3568bb

Browse files
committed
Sync memoized properties getter with 3.x version.
1 parent 9d33ecb commit b3568bb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/mixins/properties-mixin.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@
9393
if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) {
9494
let props = null;
9595

96-
if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor)) && constructor.properties) {
97-
props = normalizeProperties(constructor.properties);
96+
if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor))) {
97+
const properties = constructor.properties;
98+
99+
if (properties) {
100+
props = normalizeProperties(properties);
101+
}
98102
}
99103

100104
constructor.__ownProperties = props;
@@ -117,9 +121,12 @@
117121
* @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do
118122
*/
119123
static get observedAttributes() {
120-
Polymer.telemetry.register(this.prototype);
121-
const props = this._properties;
122-
return props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];
124+
if (!this.hasOwnProperty('__observedAttributes')) {
125+
Polymer.telemetry.register(this.prototype);
126+
const props = this._properties;
127+
this.__observedAttributes = props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];
128+
}
129+
return this.__observedAttributes;
123130
}
124131

125132
/**

0 commit comments

Comments
 (0)