Skip to content

Commit b686cd7

Browse files
author
Steven Orvell
committed
Fix more closure warnings.
1 parent 0b22959 commit b686cd7

File tree

3 files changed

+7
-39
lines changed

3 files changed

+7
-39
lines changed

closure.log

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -725,31 +725,7 @@ Found : PolymerElement
725725
this.registrations.forEach(this._regLog);
726726
^^^^
727727

728-
/polymer.html_script_12.js:81: WARNING - Type annotation references non-existent type Polymer.Debouncer.
729-
* @param {Polymer.Debouncer?} debouncer Debouncer object.
730-
^^^^^^^^^^^^^^^^^
731-
732-
/polymer.html_script_21.js:189: WARNING - Dangerous use of the global THIS object
733-
return this.node[method].apply(this.node, arguments);
734-
^^^^
735-
736-
/polymer.html_script_21.js:189: WARNING - Dangerous use of the global THIS object
737-
return this.node[method].apply(this.node, arguments);
738-
^^^^
739-
740-
/polymer.html_script_21.js:203: WARNING - Dangerous use of the global THIS object
741-
return this.node[name];
742-
^^^^
743-
744-
/polymer.html_script_21.js:215: WARNING - Dangerous use of the global THIS object
745-
return this.node[name];
746-
^^^^
747-
748-
/polymer.html_script_21.js:218: WARNING - Dangerous use of the global THIS object
749-
this.node[name] = value;
750-
^^^^
751-
752-
/polymer.html_script_21.js:339: WARNING - Property polyfillWrapFlushCallback never defined on window.customElements of type CustomElementRegistry
728+
/polymer.html_script_21.js:331: WARNING - Property polyfillWrapFlushCallback never defined on window.customElements of type CustomElementRegistry
753729
!(window.customElements.polyfillWrapFlushCallback);
754730
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
755731

@@ -1439,4 +1415,4 @@ externs/closure-types.js:759: WARNING - property toggle on interface Polymer_Arr
14391415
Polymer_ArraySelectorMixin.prototype.toggle;
14401416
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14411417

1442-
0 error(s), 315 warning(s), 72.6% typed
1418+
0 error(s), 309 warning(s), 72.6% typed

lib/legacy/polymer.dom.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,7 @@
193193
function forwardMethods(proto, methods) {
194194
for (let i=0; i < methods.length; i++) {
195195
let method = methods[i];
196-
/**
197-
* @this {DomApi}
198-
* @return {*} Returns method value
199-
*/
200-
proto[method] = function() {
196+
proto[method] = /** @this {DomApi} */ function() {
201197
return this.node[method].apply(this.node, arguments);
202198
}
203199
}
@@ -207,12 +203,8 @@
207203
for (let i=0; i < properties.length; i++) {
208204
let name = properties[i];
209205
Object.defineProperty(proto, name, {
210-
/**
211-
* @this {DomApi}
212-
* @return {*} Returns property value
213-
*/
214206
get: function() {
215-
return this.node[name];
207+
return /** @type {DomApi} */ (this).node[name];
216208
},
217209
configurable: true
218210
});
@@ -224,10 +216,10 @@
224216
let name = properties[i];
225217
Object.defineProperty(proto, name, {
226218
get: function() {
227-
return this.node[name];
219+
return /** @type {DomApi} */ (this).node[name];
228220
},
229221
set: function(value) {
230-
this.node[name] = value;
222+
/** @type {DomApi} */ (this).node[name] = value;
231223
},
232224
configurable: true
233225
});

lib/utils/debounce.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
* `_debounceWork` method. Then in a test, call `Polymer.flush` to ensure
9292
* the debouncer has completed.
9393
*
94-
* @param {Polymer.Debouncer?} debouncer Debouncer object.
94+
* @param {Debouncer?} debouncer Debouncer object.
9595
* @param {!AsyncModule} asyncModule Object with Async interface
9696
* @param {function()} callback Callback to run.
9797
* @return {!Debouncer} Returns a debouncer object.

0 commit comments

Comments
 (0)