From 9b11f1f9e766237e6bb28a8023d046a45501f96c Mon Sep 17 00:00:00 2001 From: Joshua Bruning Date: Sun, 31 Jan 2016 18:45:47 -0800 Subject: [PATCH] Fix type warning Fix type warning revealed by improved array-like object type checking in the Closure Compiler. Signed-off-by: Luke Inman-Semerau --- javascript/selenium-atoms/se_locators.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/javascript/selenium-atoms/se_locators.js b/javascript/selenium-atoms/se_locators.js index cebf2e1c62388..c7c1bc266700a 100644 --- a/javascript/selenium-atoms/se_locators.js +++ b/javascript/selenium-atoms/se_locators.js @@ -210,10 +210,12 @@ core.locators.elementFindFirstMatchingChild = function(element, selector) { for (var i = 0; i < childCount; i++) { var child = element.childNodes[i]; if (child.nodeType == goog.dom.NodeType.ELEMENT) { - if (selector(child)) { - return child; + var childEl = /** @type {!Element} */ (child); + if (selector(childEl)) { + return childEl; } - var result = core.locators.elementFindFirstMatchingChild(child, selector); + var result = core.locators.elementFindFirstMatchingChild( + childEl, selector); if (result) { return result; }