//only Can run under firefox
var test = {
name: "puterjam",
__noSuchMethod__: function(name, args){
alert(["Your call an error function [",name, "]. Arguments list: [",args,"]"].join(""));
}
}
test.hello();
test.helloWorld("china" ,"shenzhen");
When we execute an undefined method in the test object, the __noSuchMethod__ method will be automatically executed, so that we can use it to do some fault tolerance and monitoring work.