Skip to content

Commit 15090f2

Browse files
committed
Closure compilation tweaks
1 parent 1b8263f commit 15090f2

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

lib/elements/dom-repeat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class DomRepeat extends domRepeatBase {
297297
this.__sortFn = null;
298298
this.__filterFn = null;
299299
this.__observePaths = null;
300-
/** @type {?function(new:TemplateInstanceBase, *)} */
300+
/** @type {?function(new:TemplateInstanceBase, Object=)} */
301301
this.__ctor = null;
302302
this.__isDetached = true;
303303
this.template = null;

lib/legacy/mutable-data-behavior.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ export const OptionalMutableDataBehavior = {
141141
* @param {*} value New property value
142142
* @param {*} old Previous property value
143143
* @return {boolean} Whether the property should be considered a change
144-
* @this {this}
145144
* @protected
146145
*/
147146
_shouldPropertyChange(property, value, old) {

lib/legacy/templatizer-behavior.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { TemplateInstanceBase, templatize, modelForElement } from '../utils/temp
1616
* _instanceProps: Object,
1717
* _forwardHostPropV2: Function,
1818
* _notifyInstancePropV2: Function,
19-
* ctor: TemplateInstanceBase
19+
* ctor: function(new:TemplateInstanceBase, Object=)
2020
* }}
2121
*/
2222
let TemplatizerUser; // eslint-disable-line
@@ -99,13 +99,14 @@ export const Templatizer = {
9999
*/
100100
templatize(template, mutableData) {
101101
this._templatizerTemplate = template;
102-
this.ctor = templatize(template, this, {
103-
mutableData: Boolean(mutableData),
104-
parentModel: this._parentModel,
105-
instanceProps: this._instanceProps,
106-
forwardHostProp: this._forwardHostPropV2,
107-
notifyInstanceProp: this._notifyInstancePropV2
108-
});
102+
this.ctor =
103+
templatize(template, /** @type {!Polymer_PropertyEffects} */ (this), {
104+
mutableData: Boolean(mutableData),
105+
parentModel: this._parentModel,
106+
instanceProps: this._instanceProps,
107+
forwardHostProp: this._forwardHostPropV2,
108+
notifyInstanceProp: this._notifyInstancePropV2
109+
});
109110
},
110111

111112
/**

lib/utils/templatize.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function upgradeTemplate(template, constructor) {
9898
/**
9999
* Base class for TemplateInstance.
100100
* @constructor
101+
* @extends {HTMLElement}
101102
* @implements {Polymer_PropertyEffects}
102103
* @private
103104
*/
@@ -119,7 +120,9 @@ class TemplateInstanceBase extends templateInstanceBase {
119120
/** @type {!StampedTemplate} */
120121
this.root = this._stampTemplate(this.__dataHost);
121122
// Save list of stamped children
122-
let children = this.children = [];
123+
let children = [];
124+
/** @suppress {invalidCasts} */
125+
this.children = /** @type {!NodeList} */ (children);
123126
// Polymer 1.x did not use `Polymer.dom` here so not bothering.
124127
for (let n = this.root.firstChild; n; n=n.nextSibling) {
125128
children.push(n);
@@ -532,8 +535,8 @@ function createNotifyHostPropEffect() {
532535
* @param {Polymer_PropertyEffects=} owner Owner of the template instances;
533536
* any optional callbacks will be bound to this owner.
534537
* @param {Object=} options Options dictionary (see summary for details)
535-
* @return {function(new:TemplateInstanceBase)} Generated class bound to the template
536-
* provided
538+
* @return {function(new:TemplateInstanceBase, Object=)} Generated class bound
539+
* to the template provided
537540
* @suppress {invalidCasts}
538541
*/
539542
export function templatize(template, owner, options) {

0 commit comments

Comments
 (0)