Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created April 10, 2012 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaka-takayoshi/2351692 to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/2351692 to your computer and use it in GitHub Desktop.
else if (expression.indexOf("=>") == -1)
{
return new Function("$,$$,$$$,$$$$", "return " + expression).bind(Enumerable);
}
else
{
var expr = expression.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);
return new Function(expr[1], "return " + expr[2]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment