![]() |
|
|
+ Search |
![]()
|
Oct 11th, 2002 00:36
Thor Larholm, Dario Copia,
Before overriding the toString method, store a reference to it.
Function.prototype._toString = Function.prototype.toString;
Function.prototype.toString = function(){
return 'overridden';
}
function a(){
var b;
}
alert( a ) // displays 'overriden';
alert( a._toString() ); // displays the function source