Apply more let/const transforms.

This commit is contained in:
John-David Dalton
2017-01-08 23:38:19 -08:00
parent ca9e6fa087
commit 4d0c15b49e
115 changed files with 621 additions and 613 deletions

View File

@@ -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];