Skip to content

Instantly share code, notes, and snippets.

@isaacs
Forked from broofa/gist:359602
Created April 8, 2010 00:08
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 isaacs/359608 to your computer and use it in GitHub Desktop.
Save isaacs/359608 to your computer and use it in GitHub Desktop.
// no global leakage this way
function createNamedFunction(name) {
var args = Array.prototype.slice.call(arguments, 1);
var code = args.pop();
return process.compile("(function "+name+"("+args.join(",")+"){"+body+"\n})"
, "createNamedFunction-"+name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment