A Google Javascript Mystery
I've been doing some investigation in how ad managers (Google AdManager, OpenX) work, and in looking at the Google JS I came across a very strange snippet of code:
var ja = /function (^\w+)/;
function ia(a){
var b = ja.exec(String(a));
if (b) return b[1];
return "";
}
As far as I can tell, that regular expression does not match any string. What's going on? Is there a bug in the google compressor? Is this some kind of red herring? From usage, it looks like it's supposed to extract function names, but that regular expression doesn't actually work.
8 comments
[ 6.4 ms ] story [ 32.9 ms ] threadedited to add this:
so i went ahead and actually looked at the snippet. it looks like it might be a helper function in call stack debugging.