More updates based on code review.

This commit is contained in:
Kevin Schaaf
2018-07-23 21:14:05 -07:00
parent ed79071315
commit 275491e05e
4 changed files with 150 additions and 18 deletions
-5
View File
@@ -350,11 +350,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
Polymer.LegacyElementMixin(HTMLElement));
// decorate klass with registration info
klass.is = info.is;
// if user provided template on info, make sure the static _template
// is set so the static template getter uses it
if (info._template !== undefined) {
klass._template = info._template;
}
return klass;
};
+4 -4
View File
@@ -408,14 +408,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
static get template() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {
this._template =
// Take any template set on the prototype, including null (for legacy
// support, setting in registered callback, etc.)
this.prototype._template !== undefined ? this.prototype._template :
// Look in dom-module associated with this element's is
getTemplateFromDomModule(/** @type {PolymerElementConstructor}*/ (this).is) ||
// Next look for superclass template (call the super impl this
// way so that `this` points to the superclass)
Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template ||
// Finally, fall back to any _template set on prototype, e.g.
// via registered callback
this.prototype._template;
Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template;
}
return this._template;
}