From eb725f7f4de0d678c6b8c912a889d138f59bd547 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 6 Mar 2019 11:14:08 -0800 Subject: [PATCH] Fix a couple of closure type issues. * gestures - update internal type changes * debounce - fix mistaken return type --- lib/utils/debounce.js | 2 +- lib/utils/gestures.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/debounce.js b/lib/utils/debounce.js index 6cafd8cb47..622e22d35e 100644 --- a/lib/utils/debounce.js +++ b/lib/utils/debounce.js @@ -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); diff --git a/lib/utils/gestures.js b/lib/utils/gestures.js index 7b4bda4655..f5f4bfd680 100644 --- a/lib/utils/gestures.js +++ b/lib/utils/gestures.js @@ -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 @@ -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; }