mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Bump to v4.14.0.
This commit is contained in:
12
bind.js
12
bind.js
@@ -1,6 +1,6 @@
|
||||
define(['./_createWrapper', './_getHolder', './_replaceHolders', './rest'], function(createWrapper, getHolder, replaceHolders, rest) {
|
||||
define(['./_baseRest', './_createWrap', './_getHolder', './_replaceHolders'], function(baseRest, createWrap, getHolder, replaceHolders) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
PARTIAL_FLAG = 32;
|
||||
|
||||
@@ -24,9 +24,9 @@ define(['./_createWrapper', './_getHolder', './_replaceHolders', './rest'], func
|
||||
* @returns {Function} Returns the new bound function.
|
||||
* @example
|
||||
*
|
||||
* var greet = function(greeting, punctuation) {
|
||||
* function greet(greeting, punctuation) {
|
||||
* return greeting + ' ' + this.user + punctuation;
|
||||
* };
|
||||
* }
|
||||
*
|
||||
* var object = { 'user': 'fred' };
|
||||
*
|
||||
@@ -39,13 +39,13 @@ define(['./_createWrapper', './_getHolder', './_replaceHolders', './rest'], func
|
||||
* bound('hi');
|
||||
* // => 'hi fred!'
|
||||
*/
|
||||
var bind = rest(function(func, thisArg, partials) {
|
||||
var bind = baseRest(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var holders = replaceHolders(partials, getHolder(bind));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
return createWrap(func, bitmask, thisArg, partials, holders);
|
||||
});
|
||||
|
||||
// Assign default placeholders.
|
||||
|
||||
Reference in New Issue
Block a user