John Resig wrote a nifty Class function, swanky. I\'m trying to figure out what is going on, and have pretty much everything figured out except a single line:
It is just a quick & dirty way to check if "function decompilation" works.
The RegExp.prototype.test
method will take the argument and it will convert it to String, the xyz
reference inside the function is never evaluated.
Why would you have to check this?
Because the Function.prototype.toString
method returns an implementation-dependent representation of a function, and in some implementation, such older Safari versions, Mobile Opera, and some Blackberry browsers, they don't actually return anything useful.