Function.prototype.toString = function () {
return "Function code hidden";
};
function sayHi() {
alert("hi");
}
alert(sayHi.toString());
Function.prototype.originalToString = Function.prototype.toString;
Function.prototype.toString = function () {
if (this.originalToString().length > 100) {
return "too long.";
} else {
return this.originalToString();
}
};
|