Skip to content

Commit

Permalink
Fix a couple of closure type issues.
Browse files Browse the repository at this point in the history
* gestures - update internal type changes
* debounce - fix mistaken return type
  • Loading branch information
kevinpschaaf committed Mar 6, 2019
1 parent 798dfc6 commit eb725f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/utils/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const enqueueDebouncer = function(debouncer) {
/**
* Flushes any enqueued debouncers
*
* @return {void}
* @return {boolean} Returns whether any debouncers were flushed
*/
export const flushDebouncers = function() {
const didFlush = Boolean(debouncerQueue.size);
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ let mouseCanceller = function(mouseEvent) {
if (path[i].nodeType === Node.ELEMENT_NODE) {
if (path[i].localName === 'label') {
clickedLabels.push(/** @type {!HTMLLabelElement} */ (path[i]));
} else if (canBeLabelled(path[i])) {
} else if (canBeLabelled(/** @type {!HTMLElement} */ (path[i]))) {
let ownerLabels =
matchingLabels(/** @type {!HTMLElement} */ (path[i]));
// check if one of the clicked labels is labelling this element
Expand Down Expand Up @@ -387,7 +387,7 @@ export function deepTargetFind(x, y) {
* @return {EventTarget} Returns the event target.
*/
function _findOriginalTarget(ev) {
const path = getComposedPath(/** @type {?Event} */ev);
const path = getComposedPath(/** @type {?Event} */ (ev));
// It shouldn't be, but sometimes path is empty (window on Safari).
return path.length > 0 ? path[0] : ev.target;
}
Expand Down

0 comments on commit eb725f7

Please sign in to comment.