Skip to content

Commit

Permalink
Fix more closure warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 27, 2017
1 parent 2627e63 commit 0b22959
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 53 deletions.
56 changes: 6 additions & 50 deletions closure.log
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ Found : HTMLElement<|function(new:HTMLElement):?|>
window.Polymer._polymerFn = function(info) {
^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_25.js:170: WARNING - Property mutableData never defined on this of type OptionalMutableData
/polymer.html_script_25.js:173: WARNING - Property mutableData never defined on this of type OptionalMutableData
return mutablePropertyChange(this, property, value, old, this.mutableData);
^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -832,63 +832,19 @@ Found : $polymer_html_script_26$classdecl$var2<|function(new:$polymer_html_sc
return klass;
^^^^^^^^^^^^^

/polymer.html_script_27.js:117: WARNING - Property ctor never defined on this of type Polymer_LegacyElementMixin
return new this.ctor(model);
^^^^^^^^^

/polymer.html_script_27.js:132: WARNING - Property _templatizerTemplate never defined on this of type Polymer_LegacyElementMixin
return Polymer.Templatize.modelForElement(this._templatizerTemplate, el);
^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_28.js:40: WARNING - Cannot add property mutableData to a struct instance after it is constructed.
/polymer.html_script_28.js:49: WARNING - Cannot add property mutableData to a struct instance after it is constructed.
this.mutableData = true;
^^^^^^^^^^^^^^^^

/polymer.html_script_28.js:52: WARNING - Property root never defined on this of type DomBind{parentNode:Node}
this.parentNode.insertBefore(this.root, this);
^^^^^^^^^

/polymer.html_script_28.js:58: WARNING - Property root never defined on this of type DomBind{__children:{length:number} (loose)}
this.root.appendChild(this.__children[i]);
^^^^^^^^^

/polymer.html_script_28.js:77: WARNING - Function $jscomp$this.render: called with 1 argument(s). Function requires at least 0 argument(s) and at most 0.
/polymer.html_script_28.js:86: WARNING - Function $jscomp$this.render: called with 1 argument(s). Function requires at least 0 argument(s) and at most 0.
this.render(template);
^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_28.js:85: WARNING - Cannot add property root to a struct instance after it is constructed.
this.root = this._stampTemplate(template);
^^^^^^^^^

/polymer.html_script_28.js:85: WARNING - Property _stampTemplate never defined on this of type DomBind
/polymer.html_script_28.js:94: WARNING - Property _stampTemplate never defined on this of type DomBind
this.root = this._stampTemplate(template);
^^^^^^^^^^^^^^^^^^^

/polymer.html_script_28.js:86: WARNING - Cannot add property $ to a struct instance after it is constructed.
this.$ = this.root.$;
^^^^^^

/polymer.html_script_28.js:86: WARNING - Property root never defined on this of type DomBind
this.$ = this.root.$;
^^^^^^^^^

/polymer.html_script_28.js:87: WARNING - Cannot add property __children to a struct instance after it is constructed.
this.__children = [];
^^^^^^^^^^^^^^^

/polymer.html_script_28.js:88: WARNING - Property root never defined on this of type DomBind
for (let n=this.root.firstChild; n; n=n.nextSibling) {
^^^^^^^^^

/polymer.html_script_28.js:89: WARNING - Property __children never defined on this of type DomBind
this.__children[this.__children.length] = n;
^^^^^^^^^^^^^^^

/polymer.html_script_28.js:89: WARNING - Property __children never defined on this of type DomBind
this.__children[this.__children.length] = n;
^^^^^^^^^^^^^^^

/polymer.html_script_28.js:91: WARNING - Property _flushProperties never defined on this of type DomBind
/polymer.html_script_28.js:100: WARNING - Property _flushProperties never defined on this of type DomBind{__children:Array<?>, root:{$:?, firstChild:?} (loose)}
this._flushProperties();
^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1483,4 +1439,4 @@ externs/closure-types.js:759: WARNING - property toggle on interface Polymer_Arr
Polymer_ArraySelectorMixin.prototype.toggle;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 error(s), 326 warning(s), 72.6% typed
0 error(s), 315 warning(s), 72.6% typed
11 changes: 10 additions & 1 deletion lib/elements/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
* document and bind elements to the `dom-bind` element itself as the
* binding scope.
*
* @extends HTMLElement
* @mixes Polymer.PropertyEffects
* @mixes Polymer.OptionalMutableData
* @mixes Polymer.GestureEventListeners
* @extends HTMLElement
* @memberof Polymer
* @summary Custom element to allow using Polymer's template features (data
* binding, declarative event listeners, etc.) in the main document.
Expand All @@ -50,6 +52,13 @@

static get observedAttributes() { return ['mutable-data'] }

constructor() {
super();
this.root = null;
this.$ = null;
this.__children = null;
}

// assumes only one observed attribute
attributeChangedCallback() {
this.mutableData = true;
Expand Down
5 changes: 3 additions & 2 deletions lib/legacy/templatizer-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
let TemplateInstanceBase = Polymer.TemplateInstanceBase; // eslint-disable-line
/**
* @typedef {{
* _templatizerTemplate: HTMLTemplateElement,
* _parentModel: boolean,
* _instanceProps: Object,
* _forwardHostPropV2: Function,
Expand Down Expand Up @@ -123,7 +124,7 @@
* populate into the template bindings.
* @return {TemplateInstanceBase} Returns the created instance of
* the template prepared by `templatize`.
* @this {Polymer_LegacyElementMixin}
* @this {TemplatizerUser}
*/
stamp(model) {
return new this.ctor(model);
Expand All @@ -138,7 +139,7 @@
* @param {HTMLElement} el Element for which to return a template model.
* @return {TemplateInstanceBase} Model representing the binding scope for
* the element.
* @this {Polymer_LegacyElementMixin}
* @this {TemplatizerUser}
*/
modelForElement(el) {
return Polymer.Templatize.modelForElement(this._templatizerTemplate, el);
Expand Down
3 changes: 3 additions & 0 deletions lib/mixins/mutable-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@
}

}
/** @type boolean */
MutableData.prototype.mutableData = false;

return MutableData;

});


/**
* Element class mixin to add the optional ability to skip strict
* dirty-checking for objects and arrays (always consider them to be
Expand Down

0 comments on commit 0b22959

Please sign in to comment.