From 8d9f781514cdb07a33e2dbaa3431928f0e08733b Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Sun, 27 Sep 2015 16:00:12 +0000 Subject: Use strict node === node.parentNode comparison Fixes ESLint no-cond-assign warning. -- Sat, 26 Sep 2015 -- 10:38:42 +bursey | while (node = node.parentNode) is invalid 10:38:54 +bursey | should be while (node == node.parentNode) 10:40:38 +bursey | weird actually 10:40:55 +bursey | Elements tend to be "true" in js 10:41:16 +bursey | but if the parentNode is undefined, then it's | false 10:41:50 +bursey | thus it doesn't loop infinitely 10:43:00 +bursey | actually, use === instead of == --- js/pomf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/pomf.js b/js/pomf.js index bdd3174..bb14e15 100644 --- a/js/pomf.js +++ b/js/pomf.js @@ -56,7 +56,7 @@ $(function() { $(this).html(btnContent); break; } - } while (node = node.parentNode); + } while (node === node.parentNode); }); var MAX_SIZE = (function(node) { -- cgit v1.2.3