Skip to content

Commit

Permalink
Fix compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Dec 13, 2017
1 parent c7f8cf1 commit f0e31f2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
12 changes: 6 additions & 6 deletions externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ Polymer_LegacyElementMixin.prototype.flushDebouncer = function(jobName){};
*/
Polymer_LegacyElementMixin.prototype.cancelDebouncer = function(jobName){};
/**
* @param {Function} callback The callback function to run, bound to `this`.
* @param {!Function} callback The callback function to run, bound to `this`.
* @param {number=} waitTime Time to wait before calling the
`callback`. If unspecified or 0, the callback will be run at microtask
timing (before paint).
Expand All @@ -1167,18 +1167,18 @@ Polymer_LegacyElementMixin.prototype.cancelAsync = function(handle){};
Polymer_LegacyElementMixin.prototype.create = function(tag, props){};
/**
* @param {string} href URL to document to load.
* @param {Function} onload Callback to notify when an import successfully
* @param {!Function=} onload Callback to notify when an import successfully
loaded.
* @param {Function} onerror Callback to notify when an import
* @param {!Function=} onerror Callback to notify when an import
unsuccessfully loaded.
* @param {boolean} optAsync True if the import should be loaded `async`.
* @param {boolean=} optAsync True if the import should be loaded `async`.
Defaults to `false`.
* @return {HTMLLinkElement}
*/
Polymer_LegacyElementMixin.prototype.importHref = function(href, onload, onerror, optAsync){};
/**
* @param {string} selector Selector to test.
* @param {Element=} node Element to test the selector against.
* @param {!Element=} node Element to test the selector against.
* @return {boolean}
*/
Polymer_LegacyElementMixin.prototype.elementMatches = function(selector, node){};
Expand Down Expand Up @@ -1320,4 +1320,4 @@ Polymer_ArraySelectorMixin.prototype.select = function(item){};
* @param {number} idx Index from `items` array to select
* @return {void}
*/
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};
Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){};
2 changes: 1 addition & 1 deletion lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
*/
getEffectiveChildren() {
let list = this.getEffectiveChildNodes();
return list.filter(function(/** @type {Node} */ n) {
return list.filter(function(/** @type {!Node} */ n) {
return (n.nodeType === Node.ELEMENT_NODE);
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/legacy/polymer.dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

const p = Element.prototype;
/**
* @const {function(this:Element, string): boolean}
* @const {function(this:Node, string): boolean}
*/
const normalizedMatchesSelector = p.matches || p.matchesSelector ||
p.mozMatchesSelector || p.msMatchesSelector ||
Expand All @@ -28,7 +28,7 @@
*
* @function matchesSelector
* @memberof Polymer.dom
* @param {!Element} node Node to check selector against
* @param {!Node} node Node to check selector against
* @param {string} selector Selector to match
* @return {boolean} True if node matched selector
*/
Expand Down
7 changes: 5 additions & 2 deletions lib/utils/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@
},
/**
* @param {string} type
* @param {EventTarget} target
* @param {!EventTarget} target
* @param {Event} event
* @param {Function} preventer
* @return {void}
Expand Down Expand Up @@ -875,7 +875,7 @@

/**
* @this {GestureRecognizer}
* @param {EventTarget} target
* @param {!EventTarget} target
* @param {Touch} touch
* @return {void}
*/
Expand Down Expand Up @@ -984,6 +984,9 @@
let dy = Math.abs(e.clientY - this.info.y);
// find original target from `preventer` for TouchEvents, or `e` for MouseEvents
let t = Gestures._findOriginalTarget(/** @type {Event} */(preventer || e));
if (!t) {
return;
}
// dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`
if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {
// prevent taps from being generated if an event has canceled them
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
return extended;
}

return dedupingMixin;
return /** @type {T} */ (dedupingMixin);
};
/* eslint-enable valid-jsdoc */

Expand Down

0 comments on commit f0e31f2

Please sign in to comment.