[quote]Object.defineProperty(Function.prototype, "Source", {
get: function(){
return /{([\s\S]+)}/.exec(this.toString())[1];
}
});[/quote]Magic.
I seem to have posted this in the wrong place...
-
Edited by Avants Garde: 1/29/2013 11:51:08 PMI like to use the normal naming convention, starting with lowercase. Also, 'this' works, but I guess for clarity, toString is okay too. I hate floating regexes like that, so I would rather do this altogether: [quote]this.toString().match(/{([\s\S]+)}/)[1];[/quote]
-
Now can you get it to return the arguments that were past to the function?
-
Edited by DocSmurf: 1/29/2013 7:05:02 PM[redacted]
-
make a function that retrieves your brain from alcoholism
-
[quote] I seem to have posted this in the wrong place...[/quote] Really Daz...? What did you expect? I would love to help, but I'm an absolute retard when it comes to programming
-
WOAH NO WAY!!! ... ... ... ... w8 u wot m8?