123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- var baseRest = require('./_baseRest'),
- createWrap = require('./_createWrap'),
- getHolder = require('./_getHolder'),
- replaceHolders = require('./_replaceHolders');
- var WRAP_BIND_FLAG = 1,
- WRAP_PARTIAL_FLAG = 32;
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
- bind.placeholder = {};
- module.exports = bind;
|