diff --git a/lib/elements/dom-repeat.js b/lib/elements/dom-repeat.js index 2983e4ba36..cd994da4b2 100644 --- a/lib/elements/dom-repeat.js +++ b/lib/elements/dom-repeat.js @@ -297,7 +297,7 @@ export class DomRepeat extends domRepeatBase { this.__sortFn = null; this.__filterFn = null; this.__observePaths = null; - /** @type {?function(new:TemplateInstanceBase, *)} */ + /** @type {?function(new:TemplateInstanceBase, Object=)} */ this.__ctor = null; this.__isDetached = true; this.template = null; diff --git a/lib/legacy/mutable-data-behavior.js b/lib/legacy/mutable-data-behavior.js index ee236668b7..c9f46b3a62 100644 --- a/lib/legacy/mutable-data-behavior.js +++ b/lib/legacy/mutable-data-behavior.js @@ -141,7 +141,6 @@ export const OptionalMutableDataBehavior = { * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change - * @this {this} * @protected */ _shouldPropertyChange(property, value, old) { diff --git a/lib/legacy/templatizer-behavior.js b/lib/legacy/templatizer-behavior.js index 2dfbbc3a09..b06f20496f 100644 --- a/lib/legacy/templatizer-behavior.js +++ b/lib/legacy/templatizer-behavior.js @@ -16,7 +16,7 @@ import { TemplateInstanceBase, templatize, modelForElement } from '../utils/temp * _instanceProps: Object, * _forwardHostPropV2: Function, * _notifyInstancePropV2: Function, - * ctor: TemplateInstanceBase + * ctor: function(new:TemplateInstanceBase, Object=) * }} */ let TemplatizerUser; // eslint-disable-line @@ -99,13 +99,14 @@ export const Templatizer = { */ templatize(template, mutableData) { this._templatizerTemplate = template; - this.ctor = templatize(template, this, { - mutableData: Boolean(mutableData), - parentModel: this._parentModel, - instanceProps: this._instanceProps, - forwardHostProp: this._forwardHostPropV2, - notifyInstanceProp: this._notifyInstancePropV2 - }); + this.ctor = + templatize(template, /** @type {!Polymer_PropertyEffects} */ (this), { + mutableData: Boolean(mutableData), + parentModel: this._parentModel, + instanceProps: this._instanceProps, + forwardHostProp: this._forwardHostPropV2, + notifyInstanceProp: this._notifyInstancePropV2 + }); }, /** diff --git a/lib/utils/templatize.js b/lib/utils/templatize.js index ff488c15d9..9f0321f120 100644 --- a/lib/utils/templatize.js +++ b/lib/utils/templatize.js @@ -98,6 +98,7 @@ function upgradeTemplate(template, constructor) { /** * Base class for TemplateInstance. * @constructor + * @extends {HTMLElement} * @implements {Polymer_PropertyEffects} * @private */ @@ -119,7 +120,9 @@ class TemplateInstanceBase extends templateInstanceBase { /** @type {!StampedTemplate} */ this.root = this._stampTemplate(this.__dataHost); // Save list of stamped children - let children = this.children = []; + let children = []; + /** @suppress {invalidCasts} */ + this.children = /** @type {!NodeList} */ (children); // Polymer 1.x did not use `Polymer.dom` here so not bothering. for (let n = this.root.firstChild; n; n=n.nextSibling) { children.push(n); @@ -532,8 +535,8 @@ function createNotifyHostPropEffect() { * @param {Polymer_PropertyEffects=} owner Owner of the template instances; * any optional callbacks will be bound to this owner. * @param {Object=} options Options dictionary (see summary for details) - * @return {function(new:TemplateInstanceBase)} Generated class bound to the template - * provided + * @return {function(new:TemplateInstanceBase, Object=)} Generated class bound + * to the template provided * @suppress {invalidCasts} */ export function templatize(template, owner, options) {