From fa9823f78b4d57f72d96b94fe128aabc4c54a966 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 26 Apr 2017 16:46:59 -0700 Subject: [PATCH] Fix more closure warnings. --- closure.log | 586 +++++---------------------- externs/closure-types.js | 4 - lib/elements/dom-bind.html | 2 +- lib/legacy/templatizer-behavior.html | 15 + lib/mixins/property-accessors.html | 15 +- lib/mixins/property-effects.html | 12 +- lib/utils/templatize.html | 37 +- 7 files changed, 156 insertions(+), 515 deletions(-) diff --git a/closure.log b/closure.log index d78d225a39..b24117dc40 100644 --- a/closure.log +++ b/closure.log @@ -202,40 +202,40 @@ The found type is a union that includes an unexpected type: null const propertyEffectsBase = Polymer.TemplateStamp(Polymer.PropertyAccessors(superClass)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1082: WARNING - Invalid type for parameter 1 of function Object.create. +/polymer.html_script_10.js:1076: WARNING - Invalid type for parameter 1 of function Object.create. Expected : Object|null Found : * this.__data = Object.create(props); ^^^^^ -/polymer.html_script_10.js:1083: WARNING - Invalid type for parameter 1 of function Object.create. +/polymer.html_script_10.js:1077: WARNING - Invalid type for parameter 1 of function Object.create. Expected : Object|null Found : * this.__dataPending = Object.create(props); ^^^^^ -/polymer.html_script_10.js:1094: WARNING - Property __readOnly never defined on this of type PropertyEffects +/polymer.html_script_10.js:1088: WARNING - Property __readOnly never defined on this of type PropertyEffects let readOnly = this.__readOnly; ^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1095: WARNING - For/in expects an object, found type *. +/polymer.html_script_10.js:1089: WARNING - For/in expects an object, found type *. for (let prop in props) { ^^^^^ -/polymer.html_script_10.js:1099: WARNING - Cannot access property [prop] of non-object type *. +/polymer.html_script_10.js:1093: WARNING - Cannot access property [prop] of non-object type *. this.__data[prop] = this.__dataPending[prop] = props[prop]; ^^^^^ -/polymer.html_script_10.js:1286: WARNING - Invalid type for parameter 1 of function computeLinkedPaths. +/polymer.html_script_10.js:1280: WARNING - Invalid type for parameter 1 of function computeLinkedPaths. Expected : Element|null Found : PropertyEffects{__dataHasPaths:boolean} computeLinkedPaths(this, path, value); ^^^^ -/polymer.html_script_10.js:1286: WARNING - Invalid type for parameter 2 of function computeLinkedPaths. +/polymer.html_script_10.js:1280: WARNING - Invalid type for parameter 2 of function computeLinkedPaths. Expected : string Found : Array|string More details: @@ -243,252 +243,245 @@ The found type is a union that includes an unexpected type: Array computeLinkedPaths(this, path, value); ^^^^ -/polymer.html_script_10.js:1364: WARNING - Invalid redeclaration of property _setPendingProperty. -inherited type : function(this:Polymer_PropertyEffects,*,*,*):? -overriding type : function(this:PropertyEffects,string,*,boolean|undefined=):boolean - +/polymer.html_script_10.js:1358: WARNING - Missing return statement. Function expected to return boolean. _setPendingProperty(property, value, shouldNotify) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1364: WARNING - Missing return statement. Function expected to return boolean. - _setPendingProperty(property, value, shouldNotify) { - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_10.js:1526: WARNING - Invalid type for parameter 1 of function runComputedEffects. +/polymer.html_script_10.js:1520: WARNING - Invalid type for parameter 1 of function runComputedEffects. Expected : Element|null Found : PropertyEffects{__dataHasPaths:boolean} runComputedEffects(this, changedProps, oldProps, hasPaths); ^^^^ -/polymer.html_script_10.js:1526: WARNING - Invalid type for parameter 2 of function runComputedEffects. +/polymer.html_script_10.js:1520: WARNING - Invalid type for parameter 2 of function runComputedEffects. Expected : Object|null Found : * runComputedEffects(this, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^ -/polymer.html_script_10.js:1526: WARNING - Invalid type for parameter 3 of function runComputedEffects. +/polymer.html_script_10.js:1520: WARNING - Invalid type for parameter 3 of function runComputedEffects. Expected : Object|null Found : * runComputedEffects(this, changedProps, oldProps, hasPaths); ^^^^^^^^ -/polymer.html_script_10.js:1532: WARNING - Invalid type for parameter 1 of function this._propagatePropertyChanges. +/polymer.html_script_10.js:1526: WARNING - Invalid type for parameter 1 of function this._propagatePropertyChanges. Expected : Object|null Found : * this._propagatePropertyChanges(changedProps, oldProps, hasPaths); ^^^^^^^^^^^^ -/polymer.html_script_10.js:1532: WARNING - Invalid type for parameter 2 of function this._propagatePropertyChanges. +/polymer.html_script_10.js:1526: WARNING - Invalid type for parameter 2 of function this._propagatePropertyChanges. Expected : Object|null Found : * this._propagatePropertyChanges(changedProps, oldProps, hasPaths); ^^^^^^^^ -/polymer.html_script_10.js:1536: WARNING - Property __reflectEffects never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} +/polymer.html_script_10.js:1530: WARNING - Property __reflectEffects never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} runEffects(this, this.__reflectEffects, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1536: WARNING - Invalid type for parameter 3 of function runEffects. +/polymer.html_script_10.js:1530: WARNING - Invalid type for parameter 3 of function runEffects. Expected : Object|null Found : * runEffects(this, this.__reflectEffects, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^ -/polymer.html_script_10.js:1536: WARNING - Invalid type for parameter 4 of function runEffects. +/polymer.html_script_10.js:1530: WARNING - Invalid type for parameter 4 of function runEffects. Expected : Object|null|undefined Found : * runEffects(this, this.__reflectEffects, changedProps, oldProps, hasPaths); ^^^^^^^^ -/polymer.html_script_10.js:1538: WARNING - Property __observeEffects never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} +/polymer.html_script_10.js:1532: WARNING - Property __observeEffects never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} runEffects(this, this.__observeEffects, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1538: WARNING - Invalid type for parameter 3 of function runEffects. +/polymer.html_script_10.js:1532: WARNING - Invalid type for parameter 3 of function runEffects. Expected : Object|null Found : * runEffects(this, this.__observeEffects, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^ -/polymer.html_script_10.js:1538: WARNING - Invalid type for parameter 4 of function runEffects. +/polymer.html_script_10.js:1532: WARNING - Invalid type for parameter 4 of function runEffects. Expected : Object|null|undefined Found : * runEffects(this, this.__observeEffects, changedProps, oldProps, hasPaths); ^^^^^^^^ -/polymer.html_script_10.js:1541: WARNING - Invalid type for parameter 1 of function runNotifyEffects. +/polymer.html_script_10.js:1535: WARNING - Invalid type for parameter 1 of function runNotifyEffects. Expected : Element|null Found : PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths); ^^^^ -/polymer.html_script_10.js:1541: WARNING - Invalid type for parameter 3 of function runNotifyEffects. +/polymer.html_script_10.js:1535: WARNING - Invalid type for parameter 3 of function runNotifyEffects. Expected : Object|null Found : * runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths); ^^^^^^^^^^^^ -/polymer.html_script_10.js:1541: WARNING - Invalid type for parameter 4 of function runNotifyEffects. +/polymer.html_script_10.js:1535: WARNING - Invalid type for parameter 4 of function runNotifyEffects. Expected : Object|null Found : * runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths); ^^^^^^^^ -/polymer.html_script_10.js:1544: WARNING - Property __dataCounter never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} +/polymer.html_script_10.js:1538: WARNING - Property __dataCounter never defined on this of type PropertyEffects{__dataHasPaths:boolean, __dataToNotify:null} if (this.__dataCounter == 1) { ^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:1636: WARNING - Invalid type for parameter 1 of function notifySplices. +/polymer.html_script_10.js:1630: WARNING - Invalid type for parameter 1 of function notifySplices. Expected : Element|null Found : PropertyEffects notifySplices(this, array, info.path, splices); ^^^^ -/polymer.html_script_10.js:1636: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1630: WARNING - Property path never defined on info of type Object{} notifySplices(this, array, info.path, splices); ^^^^^^^^^ -/polymer.html_script_10.js:1714: WARNING - Invalid type for parameter 1 of function notifySplice. +/polymer.html_script_10.js:1708: WARNING - Invalid type for parameter 1 of function notifySplice. Expected : Element|null Found : PropertyEffects notifySplice(this, array, info.path, len, items.length, []); ^^^^ -/polymer.html_script_10.js:1714: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1708: WARNING - Property path never defined on info of type Object{} notifySplice(this, array, info.path, len, items.length, []); ^^^^^^^^^ -/polymer.html_script_10.js:1738: WARNING - Invalid type for parameter 1 of function notifySplice. +/polymer.html_script_10.js:1732: WARNING - Invalid type for parameter 1 of function notifySplice. Expected : Element|null Found : PropertyEffects notifySplice(this, array, info.path, array.length, 0, [ret]); ^^^^ -/polymer.html_script_10.js:1738: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1732: WARNING - Property path never defined on info of type Object{} notifySplice(this, array, info.path, array.length, 0, [ret]); ^^^^^^^^^ -/polymer.html_script_10.js:1774: WARNING - Invalid type for parameter 1 of function notifySplice. +/polymer.html_script_10.js:1768: WARNING - Invalid type for parameter 1 of function notifySplice. Expected : Element|null Found : PropertyEffects notifySplice(this, array, info.path, start, items.length, ret); ^^^^ -/polymer.html_script_10.js:1774: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1768: WARNING - Property path never defined on info of type Object{} notifySplice(this, array, info.path, start, items.length, ret); ^^^^^^^^^ -/polymer.html_script_10.js:1798: WARNING - Invalid type for parameter 1 of function notifySplice. +/polymer.html_script_10.js:1792: WARNING - Invalid type for parameter 1 of function notifySplice. Expected : Element|null Found : PropertyEffects notifySplice(this, array, info.path, 0, 0, [ret]); ^^^^ -/polymer.html_script_10.js:1798: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1792: WARNING - Property path never defined on info of type Object{} notifySplice(this, array, info.path, 0, 0, [ret]); ^^^^^^^^^ -/polymer.html_script_10.js:1822: WARNING - Invalid type for parameter 1 of function notifySplice. +/polymer.html_script_10.js:1816: WARNING - Invalid type for parameter 1 of function notifySplice. Expected : Element|null Found : PropertyEffects notifySplice(this, array, info.path, 0, items.length, []); ^^^^ -/polymer.html_script_10.js:1822: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1816: WARNING - Property path never defined on info of type Object{} notifySplice(this, array, info.path, 0, items.length, []); ^^^^^^^^^ -/polymer.html_script_10.js:1846: WARNING - Property path never defined on info of type Object{} +/polymer.html_script_10.js:1840: WARNING - Property path never defined on info of type Object{} propPath = info.path; ^^^^^^^^^ -/polymer.html_script_10.js:1877: WARNING - Dangerous use of the global THIS object +/polymer.html_script_10.js:1871: WARNING - Dangerous use of the global THIS object this._setProperty(property, value); ^^^^ -/polymer.html_script_10.js:2075: WARNING - Property nodeList never defined on dom of type DocumentFragment +/polymer.html_script_10.js:2069: WARNING - Property nodeList never defined on dom of type DocumentFragment templateInfo.nodeList = dom.nodeList; ^^^^^^^^^^^^ -/polymer.html_script_10.js:2088: WARNING - Property propertyEffects never defined on templateInfo of type {childNodes:Array=, nodeList:?, wasPreBound:truthy=} +/polymer.html_script_10.js:2082: WARNING - Property propertyEffects never defined on templateInfo of type {childNodes:Array=, nodeList:?, wasPreBound:truthy=} runEffects(this, templateInfo.propertyEffects, this.__data, null, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2104: WARNING - Property templateInfo never defined on dom of type DocumentFragment +/polymer.html_script_10.js:2098: WARNING - Property templateInfo never defined on dom of type DocumentFragment let templateInfo = dom.templateInfo; ^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2138: WARNING - Property _parseTemplateNode never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> +/polymer.html_script_10.js:2132: WARNING - Property _parseTemplateNode never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> let noted = super._parseTemplateNode(node, templateInfo, nodeInfo); ^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2146: WARNING - Function addBinding: called with 6 argument(s). Function requires at least 7 argument(s) and at most 7. +/polymer.html_script_10.js:2140: WARNING - Function addBinding: called with 6 argument(s). Function requires at least 7 argument(s) and at most 7. addBinding(this, templateInfo, nodeInfo, 'text', 'textContent', parts); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2182: WARNING - Property setAttribute never defined on node of type Node +/polymer.html_script_10.js:2176: WARNING - Property setAttribute never defined on node of type Node node.setAttribute(name, literal); ^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2189: WARNING - Property setAttribute never defined on node of type Node +/polymer.html_script_10.js:2183: WARNING - Property setAttribute never defined on node of type Node node.setAttribute(origName, ''); ^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2192: WARNING - Property removeAttribute never defined on node of type Node +/polymer.html_script_10.js:2186: WARNING - Property removeAttribute never defined on node of type Node node.removeAttribute(origName); ^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2203: WARNING - Property _parseTemplateNodeAttribute never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> +/polymer.html_script_10.js:2197: WARNING - Property _parseTemplateNodeAttribute never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> return super._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2221: WARNING - Property _parseTemplateNestedTemplate never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> +/polymer.html_script_10.js:2215: WARNING - Property _parseTemplateNestedTemplate never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|> let noted = super._parseTemplateNestedTemplate(node, templateInfo, nodeInfo); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2227: WARNING - Function addBinding: called with 6 argument(s). Function requires at least 7 argument(s) and at most 7. +/polymer.html_script_10.js:2221: WARNING - Function addBinding: called with 6 argument(s). Function requires at least 7 argument(s) and at most 7. addBinding(this, templateInfo, nodeInfo, 'property', '_host_' + source, parts); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2265: WARNING - Missing return statement. Function expected to return Array|null. +/polymer.html_script_10.js:2259: WARNING - Missing return statement. Function expected to return Array|null. static _parseBindings(text, templateInfo) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_10.js:2294: WARNING - Property args never defined on $jscomp$destructuring$var2 of type Object +/polymer.html_script_10.js:2288: WARNING - Property args never defined on $jscomp$destructuring$var2 of type Object let {args, methodName} = signature; ^^^^ -/polymer.html_script_10.js:2294: WARNING - Property methodName never defined on $jscomp$destructuring$var2 of type Object +/polymer.html_script_10.js:2288: WARNING - Property methodName never defined on $jscomp$destructuring$var2 of type Object let {args, methodName} = signature; ^^^^^^^^^^ -/polymer.html_script_10.js:2347: WARNING - Property source never defined on part of type Object +/polymer.html_script_10.js:2341: WARNING - Property source never defined on part of type Object } else if (path != part.source) { ^^^^^^^^^^^ -/polymer.html_script_10.js:2348: WARNING - Property source never defined on part of type Object +/polymer.html_script_10.js:2342: WARNING - Property source never defined on part of type Object value = Polymer.Path.get(inst, part.source); ^^^^^^^^^^^ -/polymer.html_script_10.js:2353: WARNING - Property __data never defined on inst of type HTMLElement +/polymer.html_script_10.js:2347: WARNING - Property __data never defined on inst of type HTMLElement value = inst.__data[path]; ^^^^^^^^^^^ @@ -645,7 +638,7 @@ Found : PolymerElement{_template:truthy} _attachDom(dom) { ^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:719: WARNING - Invalid type for parameter 1 of function propertiesForClass. +/polymer.html_script_11.js:722: WARNING - Invalid type for parameter 1 of function propertiesForClass. Expected : HTMLElement|null Found : Function|null More details: @@ -653,84 +646,70 @@ The found type is a union that includes an unexpected type: Function let type = propertiesForClass(this.constructor)[property].type; ^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:721: WARNING - Invalid type for parameter 1 of function this._attributeToProperty. -Expected : string -Found : * - - this._attributeToProperty(name, value, type); - ^^^^ - -/polymer.html_script_11.js:721: WARNING - Invalid type for parameter 2 of function this._attributeToProperty. -Expected : string -Found : * - - this._attributeToProperty(name, value, type); - ^^^^^ - -/polymer.html_script_11.js:744: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleSubtree. +/polymer.html_script_11.js:747: WARNING - Invalid type for parameter 1 of function window.ShadyCSS.styleSubtree. Expected : HTMLElement Found : PolymerElement window.ShadyCSS.styleSubtree(this, properties); ^^^^ -/polymer.html_script_11.js:761: WARNING - Function Polymer.ResolveUrl.resolveUrl: called with 1 argument(s). Function requires at least 2 argument(s) and at most 2. +/polymer.html_script_11.js:764: WARNING - Function Polymer.ResolveUrl.resolveUrl: called with 1 argument(s). Function requires at least 2 argument(s) and at most 2. base = Polymer.ResolveUrl.resolveUrl(this.importPath); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:776: WARNING - Property _parseTemplateContent never defined on polymerElementBase of type polymerElementBase<|function(new:polymerElementBase):?|> +/polymer.html_script_11.js:779: WARNING - Property _parseTemplateContent never defined on polymerElementBase of type polymerElementBase<|function(new:polymerElementBase):?|> return super._parseTemplateContent(template, templateInfo, nodeInfo); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:812: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:815: WARNING - Dangerous use of the global THIS object if (this.stack.length) { ^^^^ -/polymer.html_script_11.js:813: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:816: WARNING - Dangerous use of the global THIS object let host = this.stack[this.stack.length-1]; ^^^^ -/polymer.html_script_11.js:813: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:816: WARNING - Dangerous use of the global THIS object let host = this.stack[this.stack.length-1]; ^^^^ -/polymer.html_script_11.js:819: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:822: WARNING - Dangerous use of the global THIS object this.stack.push(inst); ^^^^ -/polymer.html_script_11.js:823: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:826: WARNING - Dangerous use of the global THIS object let stackLen = this.stack.length; ^^^^ -/polymer.html_script_11.js:824: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:827: WARNING - Dangerous use of the global THIS object if (stackLen && this.stack[stackLen-1] == inst) { ^^^^ -/polymer.html_script_11.js:825: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:828: WARNING - Dangerous use of the global THIS object this.stack.pop(); ^^^^ -/polymer.html_script_11.js:847: WARNING - Type annotation references non-existent type Polymer.Element. +/polymer.html_script_11.js:850: WARNING - Type annotation references non-existent type Polymer.Element. * @type {Array} ^^^^^^^^^^^^^^^ -/polymer.html_script_11.js:855: WARNING - Property is never defined on prototype of type HTMLElement +/polymer.html_script_11.js:858: WARNING - Property is never defined on prototype of type HTMLElement console.log('[' + prototype.is + ']: registered') ^^^^^^^^^^^^ -/polymer.html_script_11.js:863: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:866: WARNING - Dangerous use of the global THIS object this.registrations.push(prototype); ^^^^ -/polymer.html_script_11.js:864: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:867: WARNING - Dangerous use of the global THIS object Polymer.log && this._regLog(prototype); ^^^^ -/polymer.html_script_11.js:871: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:874: WARNING - Dangerous use of the global THIS object this.registrations.forEach(this._regLog); ^^^^ -/polymer.html_script_11.js:871: WARNING - Dangerous use of the global THIS object +/polymer.html_script_11.js:874: WARNING - Dangerous use of the global THIS object this.registrations.forEach(this._regLog); ^^^^ @@ -1072,36 +1051,27 @@ https://github.com/google/closure-compiler/wiki/Using-NTI-(new-type-inference)#w class GestureEventListeners extends superClass { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_21.js:6: WARNING - All constants must be typed. The compiler could not infer the type of constant normalizedMatchesSelector. Please use an explicit type annotation. For more information, see: -https://github.com/google/closure-compiler/wiki/Using-NTI-(new-type-inference)#warnings-about-uninferred-constants - const normalizedMatchesSelector = p.matches || p.matchesSelector || - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_21.js:140: WARNING - Type annotation references non-existent type type. - * @return {type} Description - ^^^^ - -/polymer.html_script_21.js:181: WARNING - Dangerous use of the global THIS object +/polymer.html_script_21.js:189: WARNING - Dangerous use of the global THIS object return this.node[method].apply(this.node, arguments); ^^^^ -/polymer.html_script_21.js:181: WARNING - Dangerous use of the global THIS object +/polymer.html_script_21.js:189: WARNING - Dangerous use of the global THIS object return this.node[method].apply(this.node, arguments); ^^^^ -/polymer.html_script_21.js:191: WARNING - Dangerous use of the global THIS object +/polymer.html_script_21.js:203: WARNING - Dangerous use of the global THIS object return this.node[name]; ^^^^ -/polymer.html_script_21.js:203: WARNING - Dangerous use of the global THIS object +/polymer.html_script_21.js:215: WARNING - Dangerous use of the global THIS object return this.node[name]; ^^^^ -/polymer.html_script_21.js:206: WARNING - Dangerous use of the global THIS object +/polymer.html_script_21.js:218: WARNING - Dangerous use of the global THIS object this.node[name] = value; ^^^^ -/polymer.html_script_21.js:320: WARNING - Property polyfillWrapFlushCallback never defined on window.customElements of type CustomElementRegistry +/polymer.html_script_21.js:339: WARNING - Property polyfillWrapFlushCallback never defined on window.customElements of type CustomElementRegistry !(window.customElements.polyfillWrapFlushCallback); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1110,223 +1080,10 @@ https://github.com/google/closure-compiler/wiki/Using-NTI-(new-type-inference)#w const legacyElementBase = Polymer.GestureEventListeners(Polymer.ElementMixin(base)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_22.js:45: WARNING - Cannot implement non-interface ? - * @implements {Polymer_LegacyElement} - ^ - -/polymer.html_script_22.js:45: WARNING - Type annotation references non-existent type Polymer_LegacyElement. - * @implements {Polymer_LegacyElement} - ^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:63: WARNING - Cannot add property isAttached to a struct instance after it is constructed. - this.isAttached = true; - ^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:75: WARNING - Cannot add property isAttached to a struct instance after it is constructed. - this.isAttached = false; - ^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:88: WARNING - Function this.attributeChanged: called with 3 argument(s). Function requires at least 0 argument(s) and at most 0. - this.attributeChanged(name, old, value); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:172: WARNING - Returned type does not match declared return type. -Expected : string -Found : string|undefined -More details: -The found type is a union that includes an unexpected type: undefined - return this._serializeValue(value); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:217: WARNING - Invalid type for parameter 1 of function this._valueToNodeAttribute. -Expected : Element|null -Found : Element|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - this._valueToNodeAttribute(node || this, value, attribute); - ^^^^^^^^^^^^ - -/polymer.html_script_22.js:314: WARNING - Property cancelable never defined on options of type {bubbles:boolean|undefined} - cancelable: Boolean(options.cancelable), - ^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:332: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : Element|null -Found : Element|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:334: WARNING - Cannot add property __boundListeners to a struct instance after it is constructed. - (this.__boundListeners = new WeakMap()); - ^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:357: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : Element|null -Found : Element|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:404: WARNING - Property getRootNode never defined on this of type LegacyElement - let root = this.getRootNode(); - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:405: WARNING - Property host never defined on root of type DocumentFragment - return (root instanceof DocumentFragment) ? root.host : root; - ^^^^^^^^^ - -/polymer.html_script_22.js:418: WARNING - Property forceRender never defined on any type in the program - this.shadowRoot.forceRender(); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:431: WARNING - Property getEffectiveChildNodes may not be present on DomApi|EventApi. - return Polymer.dom(this).getEffectiveChildNodes(); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:431: WARNING - Invalid type for parameter 1 of function Polymer.dom. -Expected : Event|Node|null -Found : LegacyElement - - return Polymer.dom(this).getEffectiveChildNodes(); - ^^^^ - -/polymer.html_script_22.js:442: WARNING - Property queryDistributedElements may not be present on DomApi|EventApi. - return Polymer.dom(this).queryDistributedElements(selector); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:442: WARNING - Invalid type for parameter 1 of function Polymer.dom. -Expected : Event|Node|null -Found : LegacyElement - - return Polymer.dom(this).queryDistributedElements(selector); - ^^^^ - -/polymer.html_script_22.js:455: WARNING - Invalid type for parameter 1 of function list.filter. -Expected : function(this:?,Node|null,number,Array):?|null -Found : function({nodeType:?} (loose)):boolean - - return list.filter(function(n) { - ^^^^^^^^^^^^^ - -/polymer.html_script_22.js:513: WARNING - Property getDistributedNodes may not be present on DomApi|EventApi. - return content ? Polymer.dom(content).getDistributedNodes() : []; - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:543: WARNING - Cannot perform strict equality / inequality comparisons on incompatible types: -left : LegacyElement -right: Node|null - return this !== node && this.contains(node) && - ^^^^ - -/polymer.html_script_22.js:543: WARNING - Property contains never defined on this of type LegacyElement - return this !== node && this.contains(node) && - ^^^^^^^^^^^^^ - -/polymer.html_script_22.js:544: WARNING - Property getRootNode never defined on this of type LegacyElement - this.getRootNode() === node.getRootNode(); - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:598: WARNING - Cannot add property _debouncers to a struct instance after it is constructed. - this._debouncers = this._debouncers || {}; - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:612: WARNING - Cannot add property _debouncers to a struct instance after it is constructed. - this._debouncers = this._debouncers || {}; - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:623: WARNING - Cannot add property _debouncers to a struct instance after it is constructed. - this._debouncers = this._debouncers || {}; - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:636: WARNING - Cannot add property _debouncers to a struct instance after it is constructed. - this._debouncers = this._debouncers || {} - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:657: WARNING - Invalid type(s) for operator BITNOT. -Expected : number -Found : * - - ~Polymer.Async.microTask.run(callback.bind(this)); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:727: WARNING - Invalid type for parameter 1 of function Polymer.dom.matchesSelector. -Expected : Node|null -Found : Element|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - return Polymer.dom.matchesSelector(node || this, selector); - ^^^^^^^^^^^^ - -/polymer.html_script_22.js:739: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : HTMLElement|null|undefined -Found : HTMLElement|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:760: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : HTMLElement|null|undefined -Found : HTMLElement|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:779: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : HTMLElement|null|undefined -Found : HTMLElement|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:795: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : HTMLElement|null|undefined -Found : HTMLElement|LegacyElement -More details: -The found type is a union that includes an unexpected type: LegacyElement - node = node || this; - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:825: WARNING - Function this.splice: called with 3 argument(s). Function requires at least 4 argument(s) and at most 4. +/polymer.html_script_22.js:863: WARNING - Function this.splice: called with 3 argument(s). Function requires at least 4 argument(s) and at most 4. return this.splice(arrayOrPath, index, 1); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_22.js:857: WARNING - parameter var_args does not appear in LegacyElement.prototype._log's parameter list - _log(...args) { - ^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:866: WARNING - parameter var_args does not appear in LegacyElement.prototype._warn's parameter list - _warn(...args) { - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:875: WARNING - parameter var_args does not appear in LegacyElement.prototype._error's parameter list - _error(...args) { - ^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:887: WARNING - parameter methodName does not appear in LegacyElement.prototype._logf's parameter list - _logf(...args) { - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:887: WARNING - parameter var_args does not appear in LegacyElement.prototype._logf's parameter list - _logf(...args) { - ^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:888: WARNING - Returned type does not match declared return type. -Expected : string -Found : Array - - return ['[%s::%s]', this.is, ...args]; - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_22.js:888: WARNING - Property is never defined on this of type LegacyElement - return ['[%s::%s]', this.is, ...args]; - ^^^^^^^ - /polymer.html_script_23.js:49: WARNING - Invalid type for parameter 1 of function _mixinBehaviors. Expected : {length:?} (loose) Found : Array|null @@ -1389,164 +1146,44 @@ Found : HTMLElement<|function(new:HTMLElement):?|> return mutablePropertyChange(this, property, value, old, this.mutableData); ^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:80: WARNING - Function this._setPendingProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3. - this._setPendingProperty(iprop, props[iprop]); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:85: WARNING - Function this._setPendingProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3. - this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:100: WARNING - Property _enqueueClient never defined on this.__dataHost of type HTMLTemplateElement - this.__dataHost._enqueueClient(this); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:110: WARNING - Property _addEventListenerToNode never defined on this._methodHost of type Object - this._methodHost._addEventListenerToNode(node, eventName, (e) => { - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:117: WARNING - Property __dataHost never defined on this.__dataHost of type HTMLTemplateElement +/polymer.html_script_26.js:118: WARNING - Property __dataHost never defined on this.__dataHost of type DataTemplate let templateHost = this.__dataHost.__dataHost; ^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:179: WARNING - Type annotation references non-existent type Polymer.PropertyEffectsInterface. - * @return {Polymer.PropertyEffectsInterface} The parent model of this instance - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:182: WARNING - Property __parentModel never defined on this of type TemplateInstanceBase - let model = this.__parentModel; - ^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:189: WARNING - Property __dataHost never defined on model.__dataHost of type HTMLTemplateElement +/polymer.html_script_26.js:190: WARNING - Property __dataHost never defined on model.__dataHost of type DataTemplate model = model.__dataHost.__dataHost; ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:191: WARNING - Cannot add property __parentModel to a struct instance after it is constructed. - this.__parentModel = model; - ^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:203: WARNING - Found two declarations for property __dataHost on type TemplateInstanceBase. - - TemplateInstanceBase.prototype.__dataHost = null; - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:209: WARNING - All constants must be typed. The compiler could not infer the type of constant MutableTemplateInstanceBase. Please use an explicit type annotation. For more information, see: -https://github.com/google/closure-compiler/wiki/Using-NTI-(new-type-inference)#warnings-about-uninferred-constants - const MutableTemplateInstanceBase = Polymer.MutableData(TemplateInstanceBase); - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_26.js:230: WARNING - Property _bindTemplate never defined on klass.prototype of type klass.prototype +/polymer.html_script_26.js:232: WARNING - Property _bindTemplate never defined on klass.prototype of type klass.prototype klass.prototype._bindTemplate(template); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:248: WARNING - Property _addPropertyEffect never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype +/polymer.html_script_26.js:250: WARNING - Property _addPropertyEffect never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype klass.prototype._addPropertyEffect('_host_' + prop, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:249: WARNING - Property PROPERTY_EFFECT_TYPES never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype +/polymer.html_script_26.js:251: WARNING - Property PROPERTY_EFFECT_TYPES never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:251: WARNING - Property _createNotifyingProperty never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype +/polymer.html_script_26.js:253: WARNING - Property _createNotifyingProperty never defined on klass.prototype of type $polymer_html_script_26$classdecl$var1.prototype klass.prototype._createNotifyingProperty('_host_' + prop); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_26.js:417: WARNING - Cannot access property constructor of non-object type *. - let templateInfo = owner.constructor._parseTemplate(template); - ^^^^^ - -/polymer.html_script_26.js:422: WARNING - Invalid type for parameter 3 of function createTemplatizerClass. -Expected : Object -Found : * - - baseClass = createTemplatizerClass(template, templateInfo, options); - ^^^^^^^ - -/polymer.html_script_26.js:426: WARNING - Invalid type for parameter 3 of function addPropagateEffects. -Expected : {forwardHostProp:?} (loose) -Found : * - - addPropagateEffects(template, templateInfo, options); - ^^^^^^^ - -/polymer.html_script_26.js:433: WARNING - Returned type does not match declared return type. +/polymer.html_script_26.js:435: WARNING - Returned type does not match declared return type. Expected : TemplateInstanceBase|null Found : $polymer_html_script_26$classdecl$var2<|function(new:$polymer_html_script_26$classdecl$var2,...?):undefined|>{prototype:$polymer_html_script_26$classdecl$var2.prototype} return klass; ^^^^^^^^^^^^^ -/polymer.html_script_26.js:474: WARNING - The right side in the assignment is not a subtype of the left side. -Expected : HTMLElement|null -Found : Node|null -More details: -The found type is a union that includes an unexpected type: Node - el = el.parentNode; - ^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:80: WARNING - Dangerous use of the global THIS object - this._templatizerTemplate = template; - ^^^^ - -/polymer.html_script_27.js:81: WARNING - Dangerous use of the global THIS object - this.ctor = Polymer.Templatize.templatize(template, this, { - ^^^^ - -/polymer.html_script_27.js:83: WARNING - Dangerous use of the global THIS object - parentModel: this._parentModel, - ^^^^ - -/polymer.html_script_27.js:83: WARNING - Property _parentModel never defined on any type in the program - parentModel: this._parentModel, - ^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:84: WARNING - Dangerous use of the global THIS object - instanceProps: this._instanceProps, - ^^^^ - -/polymer.html_script_27.js:84: WARNING - Property _instanceProps never defined on any type in the program - instanceProps: this._instanceProps, - ^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:85: WARNING - Dangerous use of the global THIS object - forwardHostProp: this._forwardHostPropV2, - ^^^^ - -/polymer.html_script_27.js:85: WARNING - Property _forwardHostPropV2 never defined on any type in the program - forwardHostProp: this._forwardHostPropV2, - ^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:86: WARNING - Dangerous use of the global THIS object - notifyInstanceProp: this._notifyInstancePropV2 - ^^^^ - -/polymer.html_script_27.js:86: WARNING - Property _notifyInstancePropV2 never defined on any type in the program - notifyInstanceProp: this._notifyInstancePropV2 - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:99: WARNING - Type annotation references non-existent type TemplateInstanceBase. - * @return {TemplateInstanceBase} Returns the created instance of - ^^^^^^^^^^^^^^^^^^^^ - -/polymer.html_script_27.js:103: WARNING - Dangerous use of the global THIS object +/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:113: WARNING - Type annotation references non-existent type TemplateInstanceBase. - * @return {TemplateInstanceBase} Model representing the binding scope for - ^^^^^^^^^^^^^^^^^^^^ + ^^^^^^^^^ -/polymer.html_script_27.js:117: WARNING - Dangerous use of the global THIS object +/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:10: WARNING - Cannot implement non-interface ? - * @implements {Polymer_GestureEventListener} - ^ - -/polymer.html_script_28.js:10: WARNING - Type annotation references non-existent type Polymer_GestureEventListener. - * @implements {Polymer_GestureEventListener} - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ^^^^^^^^^^^^^^^^^^^^^^^^^ /polymer.html_script_28.js:40: WARNING - Cannot add property mutableData to a struct instance after it is constructed. this.mutableData = true; @@ -2077,37 +1714,37 @@ Found : Element constructor() { ^^^^^^^^^^^^^^^ -/polymer.html_script_8.js:110: WARNING - Function this._attributeToProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3. +/polymer.html_script_8.js:117: WARNING - Function this._attributeToProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3. this._attributeToProperty(name, value); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_8.js:190: WARNING - Property hasAttribute never defined on this of type PropertyAccessors +/polymer.html_script_8.js:189: WARNING - Property hasAttribute never defined on this of type PropertyAccessors if (!this.hasAttribute(attribute)) { ^^^^^^^^^^^^^^^^^ -/polymer.html_script_8.js:191: WARNING - Invalid type for parameter 1 of function this._valueToNodeAttribute. +/polymer.html_script_8.js:190: WARNING - Invalid type for parameter 1 of function this._valueToNodeAttribute. Expected : Element|null Found : PropertyAccessors this._valueToNodeAttribute(this, value, attribute); ^^^^ -/polymer.html_script_8.js:223: WARNING - Invalid type for parameter 1 of function this._valueToNodeAttribute. +/polymer.html_script_8.js:222: WARNING - Invalid type for parameter 1 of function this._valueToNodeAttribute. Expected : Element|null Found : PropertyAccessors{__serializing:boolean} this._valueToNodeAttribute(this, value, ^^^^ -/polymer.html_script_8.js:373: WARNING - Dangerous use of the global THIS object +/polymer.html_script_8.js:372: WARNING - Dangerous use of the global THIS object return this.__data[property]; ^^^^ -/polymer.html_script_8.js:376: WARNING - Dangerous use of the global THIS object +/polymer.html_script_8.js:375: WARNING - Dangerous use of the global THIS object this._setProperty(property, value); ^^^^ -/polymer.html_script_8.js:417: WARNING - Missing return statement. Function expected to return boolean. +/polymer.html_script_8.js:416: WARNING - Missing return statement. Function expected to return boolean. _setPendingProperty(property, value) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2162,47 +1799,44 @@ Found : Node{$:Object{}, __noInsertionPoint:boolean, nodeList:Array} return dom; ^^^^^^^^^^^ -externs/closure-types.js:217: WARNING - Invalid redeclaration of property _setPendingProperty. -inherited type : function(this:Polymer_PropertyAccessors,string,*):boolean -overriding type : function(this:Polymer_PropertyEffects,*,*,*):? - -Polymer_PropertyEffects.prototype._setPendingProperty = function(property, value, shouldNotify){}; -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -externs/closure-types.js:378: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin +externs/closure-types.js:375: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin Polymer_ElementMixin.prototype.connectedCallback = function(){}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:382: WARNING - property disconnectedCallback not defined on any supertype of Polymer_ElementMixin +externs/closure-types.js:379: WARNING - property disconnectedCallback not defined on any supertype of Polymer_ElementMixin Polymer_ElementMixin.prototype.disconnectedCallback = function(){}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:402: WARNING - property attributeChangedCallback not defined on any supertype of Polymer_ElementMixin +externs/closure-types.js:399: WARNING - property attributeChangedCallback not defined on any supertype of Polymer_ElementMixin Polymer_ElementMixin.prototype.attributeChangedCallback = function(name, old, value){}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:717: WARNING - property mutableData on interface Polymer_OptionalMutableData is not implemented by type OptionalMutableData +externs/closure-types.js:528: WARNING - Type annotation references non-existent type fireOptions. +* @param {fireOptions=} options + ^^^^^^^^^^^ + +externs/closure-types.js:733: WARNING - property mutableData on interface Polymer_OptionalMutableData is not implemented by type OptionalMutableData Polymer_OptionalMutableData.prototype.mutableData; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:731: WARNING - property items on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin +externs/closure-types.js:747: WARNING - property items on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin Polymer_ArraySelectorMixin.prototype.items; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:734: WARNING - property multi on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin +externs/closure-types.js:750: WARNING - property multi on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin Polymer_ArraySelectorMixin.prototype.multi; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:737: WARNING - property selected on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin +externs/closure-types.js:753: WARNING - property selected on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin Polymer_ArraySelectorMixin.prototype.selected; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:740: WARNING - property selectedItem on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin +externs/closure-types.js:756: WARNING - property selectedItem on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin Polymer_ArraySelectorMixin.prototype.selectedItem; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -externs/closure-types.js:743: WARNING - property toggle on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin +externs/closure-types.js:759: WARNING - property toggle on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin Polymer_ArraySelectorMixin.prototype.toggle; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0 error(s), 482 warning(s), 71.2% typed +0 error(s), 410 warning(s), 71.8% typed diff --git a/externs/closure-types.js b/externs/closure-types.js index 46ecd93183..70eb2de07d 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -144,10 +144,6 @@ Polymer_TemplateStamp.prototype._removeEventListenerFromNode = function(node, ev function Polymer_PropertyEffects(){} /** * @override -*/ -Polymer_PropertyEffects.prototype._initializeProperties = function(){}; -/** -* @override * @param {*} props */ Polymer_PropertyEffects.prototype._initializeProtoProperties = function(props){}; diff --git a/lib/elements/dom-bind.html b/lib/elements/dom-bind.html index 436791d85c..874e374af9 100644 --- a/lib/elements/dom-bind.html +++ b/lib/elements/dom-bind.html @@ -22,7 +22,7 @@ * @constructor * @implements {Polymer_PropertyEffects} * @implements {Polymer_OptionalMutableData} - * @implements {Polymer_GestureEventListener} + * @implements {Polymer_GestureEventListeners} * @extends {HTMLElement} */ const domBindBase = diff --git a/lib/legacy/templatizer-behavior.html b/lib/legacy/templatizer-behavior.html index 4f3a14aa85..8d6018b64f 100644 --- a/lib/legacy/templatizer-behavior.html +++ b/lib/legacy/templatizer-behavior.html @@ -14,6 +14,18 @@ (function() { 'use strict'; + let TemplateInstanceBase = Polymer.TemplateInstanceBase; // eslint-disable-line + /** + * @typedef {{ + * _parentModel: boolean, + * _instanceProps: Object, + * _forwardHostPropV2: Function, + * _notifyInstancePropV2: Function, + * ctor: TemplateInstanceBase + * }} + */ + let TemplatizerUser; // eslint-disable-line + /** * The `Polymer.Templatizer` behavior adds methods to generate instances of * templates that are each managed by an anonymous `Polymer.PropertyEffects` @@ -87,6 +99,7 @@ * @param {boolean=} mutableData When `true`, the generated class will skip * strict dirty-checking for objects and arrays (always consider them to * be "dirty"). Defaults to false. + * @this {TemplatizerUser} */ templatize(template, mutableData) { this._templatizerTemplate = template; @@ -110,6 +123,7 @@ * populate into the template bindings. * @return {TemplateInstanceBase} Returns the created instance of * the template prepared by `templatize`. + * @this {Polymer_LegacyElementMixin} */ stamp(model) { return new this.ctor(model); @@ -124,6 +138,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} */ modelForElement(el) { return Polymer.Templatize.modelForElement(this._templatizerTemplate, el); diff --git a/lib/mixins/property-accessors.html b/lib/mixins/property-accessors.html index a586f31a2d..9da61d5922 100644 --- a/lib/mixins/property-accessors.html +++ b/lib/mixins/property-accessors.html @@ -117,6 +117,13 @@ constructor() { super(); + this.__serializing = false; + this.__dataCounter = 0; + this.__dataInitialized = false; + this.__dataInvalid = false; + this.__data = {}; + this.__dataPending = null; + this.__dataOld = null; this._initializeProperties(); } @@ -135,14 +142,6 @@ * @protected */ _initializeProperties() { - this.__serializing = false; - this.__dataCounter = 0; - this.__dataInitialized = false; - this.__dataInvalid = false; - // initialize data with prototype values saved when creating accessors - this.__data = {}; - this.__dataPending = null; - this.__dataOld = null; if (this.__dataProto) { this._initializeProtoProperties(this.__dataProto); this.__dataProto = null; diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 0e194999da..2d1e18536f 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -1073,15 +1073,8 @@ return TYPES; } - /** - * Overrides `Polymer.PropertyAccessors` implementation to initialize - * additional property-effect related properties. - * - * @override - */ - _initializeProperties() { - super._initializeProperties(); - this.__dataClientsInitialized = false; + constructor() { + super(); this.__dataPendingClients = null; this.__dataToNotify = null; this.__dataLinkedPaths = null; @@ -1090,6 +1083,7 @@ this.__dataCompoundStorage = this.__dataCompoundStorage || null; this.__dataHost = this.__dataHost || null; this.__dataTemp = {}; + this.__dataClientsInitialized = false; } /** diff --git a/lib/utils/templatize.html b/lib/utils/templatize.html index 0d78e1c3a6..21f5cc9ce5 100644 --- a/lib/utils/templatize.html +++ b/lib/utils/templatize.html @@ -59,6 +59,7 @@ * @implements {Polymer_PropertyEffects} */ const base = Polymer.PropertyEffects(class {}); + /** @unrestricted */ class TemplateInstanceBase extends base { constructor(props) { super(); @@ -190,7 +191,7 @@ * is either another templatize instance that had option `parentModel: true`, * or else the host element. * - * @return {Polymer.PropertyEffectsInterface} The parent model of this instance + * @return {Polymer_PropertyEffects} The parent model of this instance */ get parentModel() { let model = this.__parentModel; @@ -207,19 +208,22 @@ return model; } } - /** @type {HTMLTemplateElement} */ + /** @type {DataTemplate} */ TemplateInstanceBase.prototype.__dataHost = null; /** @type {Object} */ TemplateInstanceBase.prototype.__templatizeOptions = null; - /** @type {Object} */ + /** @type {Polymer_PropertyEffects} */ TemplateInstanceBase.prototype._methodHost = null; /** @type {Object} */ - TemplateInstanceBase.prototype.__dataHost = null; - /** @type {Object} */ TemplateInstanceBase.prototype.__templatizeOwner = null; /** @type {Object} */ TemplateInstanceBase.prototype.__hostProps = null; + /** + * @constructor + * @extends {TemplateInstanceBase} + * @implements {Polymer_MutableData} + */ const MutableTemplateInstanceBase = Polymer.MutableData(TemplateInstanceBase); function findMethodHost(template) { @@ -234,9 +238,7 @@ function createTemplatizerClass(template, templateInfo, options) { // Anonymous class created by the templatize - /** - * @unrestricted - */ + /** @unrestricted */ let base = options.mutableData ? MutableTemplateInstanceBase : TemplateInstanceBase; let klass = class extends base { } @@ -416,9 +418,9 @@ * * @memberof Polymer.Templatize * @param {HTMLTemplateElement} template Template to templatize - * @param {*} owner Owner of the template instances; any optional callbacks - * will be bound to this owner. - * @param {*=} options Options dictionary (see summary for details) + * @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 {TemplateInstanceBase} Generated class bound to the template * provided */ @@ -464,28 +466,28 @@ * @memberof Polymer.Templatize * @param {HTMLTemplateElement} template The model will be returned for * elements stamped from this template - * @param {HTMLElement} el Element for which to return a template model. + * @param {Node} node Node for which to return a template model. * @return {TemplateInstanceBase} Template instance representing the * binding scope for the element */ - modelForElement(template, el) { + modelForElement(template, node) { let model; - while (el) { + while (node) { // An element with a __templatizeInstance marks the top boundary // of a scope; walk up until we find one, and then ensure that // its __dataHost matches `this`, meaning this dom-repeat stamped it - if ((model = el.__templatizeInstance)) { + if ((model = node.__templatizeInstance)) { // Found an element stamped by another template; keep walking up // from its __dataHost if (model.__dataHost != template) { - el = model.__dataHost; + node = model.__dataHost; } else { return model; } } else { // Still in a template scope, keep going up until // a __templatizeInstance is found - el = el.parentNode; + node = node.parentNode; } } return null; @@ -493,6 +495,7 @@ } Polymer.Templatize = Templatize; + Polymer.TemplateInstanceBase = TemplateInstanceBase; })();