Skip to content

Instantly share code, notes, and snippets.

@lance
Created May 21, 2014 16:45
Show Gist options
  • Save lance/89c6737a5f6e55628b84 to your computer and use it in GitHub Desktop.
Save lance/89c6737a5f6e55628b84 to your computer and use it in GitHub Desktop.
function delegateFunction(f) {
return function() {
var args = Array.prototype.slice.call(arguments);
var last = args.pop();
if (typeof last === 'function') {
args.push(nodyn.vertxHandler(last));
} else if (last !== undefined) {
args.push(last);
}
f.apply(f, args);
};
}
FS.rename = delegateFunction(system.move);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment