12345678910111213141516171819202122232425262728 |
- import createCtor from './_createCtor.js';
- import root from './_root.js';
- var WRAP_BIND_FLAG = 1;
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- export default createBind;
|