Skip to content

Instantly share code, notes, and snippets.

@bnjbvr
Last active December 24, 2015 05:29
Show Gist options
  • Save bnjbvr/6750933 to your computer and use it in GitHub Desktop.
Save bnjbvr/6750933 to your computer and use it in GitHub Desktop.
Proxy all Math calls
var proxy = {
get: function(target, name, receiver) {
var original = target[name];
return function() {
// for instance, print all arguments
for(var i = 0; i<arguments.length;++i)
print(arguments[i]);
return original.apply(receiver, arguments)
}
}
}
Math = new Proxy(Math, proxy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment