mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
More updates based on code review.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user