Reduce _.wrap by taking advantage of createBound.

This commit is contained in:
John-David Dalton
2013-10-18 08:21:30 -07:00
parent c30460df4c
commit fb4a861c0d
8 changed files with 56 additions and 58 deletions

View File

@@ -4073,14 +4073,7 @@
* // => '<div>Fred, Wilma, &amp; Pebbles</div>'
*/
function wrap(value, wrapper) {
if (!isFunction(wrapper)) {
throw new TypeError;
}
return function() {
var args = [value];
push.apply(args, arguments);
return wrapper.apply(this, args);
};
return createBound(wrapper, 16, [value]);
}
/*--------------------------------------------------------------------------*/