From 9a4d1b4c8bdd8ef11b1d0102a4eee188c4c4f011 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 27 Nov 2009 15:00:50 +0000 Subject: [PATCH] Use hasOwnProperty to eliminate unhelpful JS stuff in Object --- yarrg/web/query_age | 1 + yarrg/web/tabsort | 1 + 2 files changed, 2 insertions(+) diff --git a/yarrg/web/query_age b/yarrg/web/query_age index efd7096..4f8ba81 100644 --- a/yarrg/web/query_age +++ b/yarrg/web/query_age @@ -123,6 +123,7 @@ Time since this page loaded: var now= Date.now(); debug('updating now='+now); for (var ageid in <% $jsprefix %>ages) { + if (!<% $jsprefix %>ages.hasOwnProperty(ageid)) continue; var oldage= <% $jsprefix %>ages[ageid]; var el= document.getElementById(<% $elemidprefix %>ageid); var age= oldage + (now - da_pageload) / 1000; diff --git a/yarrg/web/tabsort b/yarrg/web/tabsort index 45d5e69..5031a98 100644 --- a/yarrg/web/tabsort +++ b/yarrg/web/tabsort @@ -166,6 +166,7 @@ function ts_onload__<% $table %>() { debug('thlist='+thlist); debug('thlist.item(2)=' + thlist.item(2)); for (var cix in ts_add_heads) { + if (!ts_add_heads.hasOwnProperty(cix)) continue; var ah = ts_add_heads[cix]; debug('appending to cix='+cix+' ah='+ah); thlist.item(cix).innerHTML += ah; -- 2.30.2