MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / part

Function part

lib/web/polyfill.js:105–123  ·  view source on GitHub ↗
(/* ...args */)

Source from the content-addressed store, hash-verified

103 , REFERENCE_GET;
104// Partial apply
105function part(/* ...args */){
106 var fn = assertFunction(this)
107 , length = arguments.length
108 , args = Array(length)
109 , i = 0
110 , _ = path._
111 , holder = false;
112 while(length > i)if((args[i] = arguments[i++]) === _)holder = true;
113 return function(/* ...args */){
114 var that = this
115 , _length = arguments.length
116 , i = 0, j = 0, _args;
117 if(!holder && !_length)return invoke(fn, args, that);
118 _args = args.slice();
119 if(holder)for(;length > i; i++)if(_args[i] === _)_args[i] = arguments[j++];
120 while(_length > j)_args.push(arguments[j++]);
121 return invoke(fn, _args, that);
122 }
123}
124// Optional / simple context binding
125function ctx(fn, that, length){
126 assertFunction(fn);

Callers

nothing calls this directly

Calls 3

assertFunctionFunction · 0.85
invokeFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected