From 0d0da5696715e9986d1d624186a91f5ece47e0ce Mon Sep 17 00:00:00 2001 From: Peter Burns Date: Mon, 4 Mar 2019 15:27:50 -0800 Subject: [PATCH] Fix/suppress upcoming JSCompiler build errors Upstreaming cl/236195240 from the jscompiler team. These errors come from the compiler incorrectly overriding JSDoc on a declaration with its right-hand-side. In some cases the JSDoc should not have been there; in other cases the JSDoc was correct and this reveals an error elsewhere. --- lib/utils/gestures.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils/gestures.js b/lib/utils/gestures.js index 54b2173717..7b4bda4655 100644 --- a/lib/utils/gestures.js +++ b/lib/utils/gestures.js @@ -178,9 +178,10 @@ let mouseCanceller = function(mouseEvent) { for (let i = 0; i < path.length; i++) { if (path[i].nodeType === Node.ELEMENT_NODE) { if (path[i].localName === 'label') { - clickedLabels.push(path[i]); + clickedLabels.push(/** @type {!HTMLLabelElement} */ (path[i])); } else if (canBeLabelled(path[i])) { - let ownerLabels = matchingLabels(path[i]); + let ownerLabels = + matchingLabels(/** @type {!HTMLElement} */ (path[i])); // check if one of the clicked labels is labelling this element for (let j = 0; j < ownerLabels.length; j++) { clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1; @@ -386,7 +387,7 @@ export function deepTargetFind(x, y) { * @return {EventTarget} Returns the event target. */ function _findOriginalTarget(ev) { - const path = getComposedPath(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; }