From 2dbb6f9a54eb5ff5847eed11c85ac4cf119eb41c Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Sat, 19 Oct 2013 15:41:06 -0400 Subject: fix(isElement): return boolean value rather than `truthy` value. angular.isElement currently returns a truthy object/function, or false. This patch aims to correct this behaviour by casting the result of the isElement expression to a boolean value via double-negation. Closes #4519 Closes #4534 --- src/Angular.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index 691ddbc6..478ef2a2 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -565,9 +565,9 @@ var trim = (function() { * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). */ function isElement(node) { - return node && + return !!(node && (node.nodeName // we are a direct element - || (node.on && node.find)); // we have an on and find method part of jQuery API + || (node.on && node.find))); // we have an on and find method part of jQuery API } /** -- cgit v1.2.3