Created
January 20, 2010 17:26
-
-
Save silentrob/282023 to your computer and use it in GitHub Desktop.
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
Repeat = {}; | |
Repeat.__noSuchMethod__ = function __noSuchMethod__ (id, args) { | |
var numTimes = /x([0-9]+)/.exec(id); | |
if (numTimes != null) { | |
for (var i = 0;i < numTimes[1]; i++) { | |
if (typeof args[0] == 'function') { | |
args[0](); | |
} else { | |
system.console.log(args[0]); | |
} | |
} | |
} | |
}; | |
Repeat.x10( function(){ system.console.log("Run this code")} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment