diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 18:00:12 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2015-09-27 18:14:32 +0200 |
| commit | 8d9f781514cdb07a33e2dbaa3431928f0e08733b (patch) | |
| tree | 4282f82492b8aa6adf44bf48a5d2559e0ec5084e /js | |
| parent | 64bc5c47da06fbb6b638f2c95e44f081089fc7c3 (diff) | |
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 ==
Diffstat (limited to 'js')
| -rw-r--r-- | js/pomf.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -56,7 +56,7 @@ $(function() { $(this).html(btnContent); break; } - } while (node = node.parentNode); + } while (node === node.parentNode); }); var MAX_SIZE = (function(node) { |
