rem: var matches = h.innerHTML.match(anchor); if (matches) h.set('id', matches[1]); h.innerHTML = h.innerHTML.replace(anchor, ''); }); 
add: var matches = h.innerHTML.match(anchor); if (matches) h.set('id', matches[1]); h.innerHTML = h.innerHTML.replace(anchor, ''); }); 
context:     temp.getElements('h1, h2, h3, h4, h5, h6').each(function(h){      var matches = h.innerHTML.match(anchor);      if (matches) h.set('id', matches[1]);      h.innerHTML = h.innerHTML.replace(anchor, '');    });
meta: 6317	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6317/bb7ba4f85620c5ad07e48227c0a1b87153a9c92a/docs.js/buggy/Docs/assets/docs.js