Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var foo = {
- bar: function(x) {
- x.squeeze();
- }
- };
- // this call will break your application :)
- // opps, TypeError: Object 42 has no method 'squeeze' :)
- foo.bar(42);
- var errHandler = function(obj, meth, args, err) {
- alert(["error invoking method on object: ", obj, ", method: ", meth, ", ",args,", err : ", err].join(" "));
- }
- contain(foo, errHandler);
- // this call's errors will now be managed, oh snap
- foo.bar(42);
Add Comment
Please, Sign In to add comment