Skip to content

Commit f0e31f2

Browse files
committed
Fix compilation errors.
1 parent c7f8cf1 commit f0e31f2

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

externs/closure-types.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ Polymer_LegacyElementMixin.prototype.flushDebouncer = function(jobName){};
11451145
*/
11461146
Polymer_LegacyElementMixin.prototype.cancelDebouncer = function(jobName){};
11471147
/**
1148-
* @param {Function} callback The callback function to run, bound to `this`.
1148+
* @param {!Function} callback The callback function to run, bound to `this`.
11491149
* @param {number=} waitTime Time to wait before calling the
11501150
`callback`. If unspecified or 0, the callback will be run at microtask
11511151
timing (before paint).
@@ -1167,18 +1167,18 @@ Polymer_LegacyElementMixin.prototype.cancelAsync = function(handle){};
11671167
Polymer_LegacyElementMixin.prototype.create = function(tag, props){};
11681168
/**
11691169
* @param {string} href URL to document to load.
1170-
* @param {Function} onload Callback to notify when an import successfully
1170+
* @param {!Function=} onload Callback to notify when an import successfully
11711171
loaded.
1172-
* @param {Function} onerror Callback to notify when an import
1172+
* @param {!Function=} onerror Callback to notify when an import
11731173
unsuccessfully loaded.
1174-
* @param {boolean} optAsync True if the import should be loaded `async`.
1174+
* @param {boolean=} optAsync True if the import should be loaded `async`.
11751175
Defaults to `false`.
11761176
* @return {HTMLLinkElement}
11771177
*/
11781178
Polymer_LegacyElementMixin.prototype.importHref = function(href, onload, onerror, optAsync){};
11791179
/**
11801180
* @param {string} selector Selector to test.
1181-
* @param {Element=} node Element to test the selector against.
1181+
* @param {!Element=} node Element to test the selector against.
11821182
* @return {boolean}
11831183
*/
11841184
Polymer_LegacyElementMixin.prototype.elementMatches = function(selector, node){};
@@ -1320,4 +1320,4 @@ Polymer_ArraySelectorMixin.prototype.select = function(item){};
13201320
* @param {number} idx Index from `items` array to select
13211321
* @return {void}
13221322
*/
1323-
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};
1323+
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};

lib/legacy/legacy-element-mixin.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@
517517
*/
518518
getEffectiveChildren() {
519519
let list = this.getEffectiveChildNodes();
520-
return list.filter(function(/** @type {Node} */ n) {
520+
return list.filter(function(/** @type {!Node} */ n) {
521521
return (n.nodeType === Node.ELEMENT_NODE);
522522
});
523523
}

lib/legacy/polymer.dom.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
const p = Element.prototype;
1919
/**
20-
* @const {function(this:Element, string): boolean}
20+
* @const {function(this:Node, string): boolean}
2121
*/
2222
const normalizedMatchesSelector = p.matches || p.matchesSelector ||
2323
p.mozMatchesSelector || p.msMatchesSelector ||
@@ -28,7 +28,7 @@
2828
*
2929
* @function matchesSelector
3030
* @memberof Polymer.dom
31-
* @param {!Element} node Node to check selector against
31+
* @param {!Node} node Node to check selector against
3232
* @param {string} selector Selector to match
3333
* @return {boolean} True if node matched selector
3434
*/

lib/utils/gestures.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@
706706
},
707707
/**
708708
* @param {string} type
709-
* @param {EventTarget} target
709+
* @param {!EventTarget} target
710710
* @param {Event} event
711711
* @param {Function} preventer
712712
* @return {void}
@@ -875,7 +875,7 @@
875875

876876
/**
877877
* @this {GestureRecognizer}
878-
* @param {EventTarget} target
878+
* @param {!EventTarget} target
879879
* @param {Touch} touch
880880
* @return {void}
881881
*/
@@ -984,6 +984,9 @@
984984
let dy = Math.abs(e.clientY - this.info.y);
985985
// find original target from `preventer` for TouchEvents, or `e` for MouseEvents
986986
let t = Gestures._findOriginalTarget(/** @type {Event} */(preventer || e));
987+
if (!t) {
988+
return;
989+
}
987990
// dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`
988991
if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {
989992
// prevent taps from being generated if an event has canceled them

lib/utils/mixin.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
return extended;
7070
}
7171

72-
return dedupingMixin;
72+
return /** @type {T} */ (dedupingMixin);
7373
};
7474
/* eslint-enable valid-jsdoc */
7575

0 commit comments

Comments
 (0)