[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]