mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Apply more let/const transforms.
This commit is contained in:
@@ -3,7 +3,7 @@ import createCtor from './_createCtor.js';
|
||||
import root from './_root.js';
|
||||
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var WRAP_BIND_FLAG = 1;
|
||||
const WRAP_BIND_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke it with the `this` binding
|
||||
@@ -18,16 +18,17 @@ var WRAP_BIND_FLAG = 1;
|
||||
* @returns {Function} Returns the new wrapped function.
|
||||
*/
|
||||
function createPartial(func, bitmask, thisArg, partials) {
|
||||
var isBind = bitmask & WRAP_BIND_FLAG,
|
||||
Ctor = createCtor(func);
|
||||
const isBind = bitmask & WRAP_BIND_FLAG;
|
||||
const Ctor = createCtor(func);
|
||||
|
||||
function wrapper() {
|
||||
var argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
args = Array(leftLength + argsLength),
|
||||
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
let argsIndex = -1;
|
||||
let argsLength = arguments.length;
|
||||
let leftIndex = -1;
|
||||
|
||||
const leftLength = partials.length;
|
||||
const args = Array(leftLength + argsLength);
|
||||
const fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
args[leftIndex] = partials[leftIndex];
|
||||
|
||||
Reference in New Issue
Block a user