Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // async: manually sets the length of a function by wrapping it in another with the desired length
- fab.arity = function( num ) {
- var fn = function(_){ fn.apply( this, arguments ) }
- , ends = [ "this(", ")" ]
- , args = [];
- while ( --num ) args[ num - 1 ] = "_" + num;
- this( Function( "fn", ends.join( fn ).replace( "_", args ) ) );
- }
Add Comment
Please, Sign In to add comment