rem: var sheets = document.styleSheets; for(var i = 0; i < sheets.length; i++) {  if(anySetRE.test(sheets[i].href)) sheets[i].disabled = !thisSetRE.test(sheets[i].href); } 
add: const sheets = document.styleSheets, num = sheets.length; for(var i = 0; i != num; i++) if(sheets[i].title) sheets[i].disabled = sheets[i].title!=set; 
context: function useCardSet(set) {  // XXX: Ideally the disabling of stylesheets would be based on their titles, but  // when testing on Fb 20031209 win32 build the title of every sheet would be OK  // the first time Cards was loaded, but then be an empty string every subsequent  // load until Firebird was restarted.  Hence we use this hack based on the href  var anySetRE = /\/cardsets\/[^.]*\.css$/;  var thisSetRE = new RegExp(set+".css$");  // switch stylesheets  var sheets = document.styleSheets;  for(var i = 0; i < sheets.length; i++) {//    if(sheets[i].title) sheets[i].disabled = (sheets[i].title!=set);    if(anySetRE.test(sheets[i].href)) sheets[i].disabled = !thisSetRE.test(sheets[i].href);  }  // save pref  gPrefs.setCharPref("cardset",set);}
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/fb58f1ed0e84d2307545949935f23a943903f015/cardslib.js/buggy/cardslib.js