Skip to content

Instantly share code, notes, and snippets.

@eirikb
Created June 24, 2014 10:39
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 eirikb/bf72f7c2d6e5c0e8fef8 to your computer and use it in GitHub Desktop.
Save eirikb/bf72f7c2d6e5c0e8fef8 to your computer and use it in GitHub Desktop.
Dependencyhackjection
var d={a:1,b:2},f=function(a,b){return a+b};f.apply(null,(''+f).match(/function[^(]*\(([^)]*)\)/)[1].split(/,\s*/).map(function(x){return d[x]}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment