chiark / gitweb /
Use hasOwnProperty to eliminate unhelpful JS stuff in Object
authorIan Jackson <ian@liberator.(none)>
Fri, 27 Nov 2009 15:00:50 +0000 (15:00 +0000)
committerIan Jackson <ian@liberator.(none)>
Fri, 27 Nov 2009 15:00:50 +0000 (15:00 +0000)
yarrg/web/query_age
yarrg/web/tabsort

index efd709692a855426a1ae3f7ca819a2f009ce8b4f..4f8ba814b7f1e5ddf2b0ce0fc22549ad560b728d 100644 (file)
@@ -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;
index 45d5e69e3763f56cbd2a1e1b888ad26261094116..5031a988382acf63c15cf7f736cb710bce77c379 100644 (file)
@@ -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;