Last active
December 24, 2015 05:29
-
-
Save bnjbvr/6750933 to your computer and use it in GitHub Desktop.
Proxy all Math calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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