Created
June 4, 2014 20:02
-
-
Save jwerle/2cf04b444a1f468f088e to your computer and use it in GitHub Desktop.
This file contains 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
function b (fn) { | |
var str = fn.toString(); | |
var buf = ""; | |
var ch = 0; | |
var len = str.length; | |
var i = 0; | |
var inBody = false; | |
while (len--) { | |
ch = str[i++]; | |
if ('{' == ch) { | |
inBody = true; | |
continue; | |
} | |
if (inBody) { | |
if (len > 0) { | |
buf += ch; | |
continue; | |
} else { | |
break; | |
} | |
} | |
} | |
return buf; | |
} | |
function x () { | |
$(window).find('.foo').children('.bar').trigger('click'); | |
console.log('I clicked some shit !'); | |
} | |
console.log(b(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment