From: Ian Jackson Date: Fri, 27 Nov 2009 15:00:50 +0000 (+0000) Subject: Use hasOwnProperty to eliminate unhelpful JS stuff in Object X-Git-Tag: 6.2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=9a4d1b4c8bdd8ef11b1d0102a4eee188c4c4f011 Use hasOwnProperty to eliminate unhelpful JS stuff in Object --- 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;