mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Use freeParseFloat and freeParseInt.
This commit is contained in:
11
lodash.js
11
lodash.js
@@ -228,7 +228,7 @@
|
|||||||
'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
|
'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
|
||||||
'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
|
'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
|
||||||
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_',
|
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_',
|
||||||
'clearTimeout', 'isFinite', 'parseFloat', 'parseInt', 'setTimeout'
|
'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Used to make template sourceURLs easier to identify. */
|
/** Used to make template sourceURLs easier to identify. */
|
||||||
@@ -322,6 +322,10 @@
|
|||||||
'\u2029': 'u2029'
|
'\u2029': 'u2029'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Built-in method references without a dependency on `root`. */
|
||||||
|
var freeParseFloat = parseFloat,
|
||||||
|
freeParseInt = parseInt;
|
||||||
|
|
||||||
/** Detect free variable `exports`. */
|
/** Detect free variable `exports`. */
|
||||||
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
|
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
|
||||||
|
|
||||||
@@ -1283,7 +1287,6 @@
|
|||||||
getPrototypeOf = Object.getPrototypeOf,
|
getPrototypeOf = Object.getPrototypeOf,
|
||||||
getOwnPropertySymbols = Object.getOwnPropertySymbols,
|
getOwnPropertySymbols = Object.getOwnPropertySymbols,
|
||||||
iteratorSymbol = typeof (iteratorSymbol = _Symbol && _Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
|
iteratorSymbol = typeof (iteratorSymbol = _Symbol && _Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
|
||||||
parseFloat = context.parseFloat,
|
|
||||||
pow = Math.pow,
|
pow = Math.pow,
|
||||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||||
setTimeout = context.setTimeout,
|
setTimeout = context.setTimeout,
|
||||||
@@ -10243,7 +10246,7 @@
|
|||||||
value = value.replace(reTrim, '');
|
value = value.replace(reTrim, '');
|
||||||
var isBinary = reIsBinary.test(value);
|
var isBinary = reIsBinary.test(value);
|
||||||
return (isBinary || reIsOctal.test(value))
|
return (isBinary || reIsOctal.test(value))
|
||||||
? nativeParseInt(value.slice(2), isBinary ? 2 : 8)
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
||||||
: (reIsBadHex.test(value) ? NAN : +value);
|
: (reIsBadHex.test(value) ? NAN : +value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11708,7 +11711,7 @@
|
|||||||
}
|
}
|
||||||
if (floating || min % 1 || max % 1) {
|
if (floating || min % 1 || max % 1) {
|
||||||
var rand = nativeRandom();
|
var rand = nativeRandom();
|
||||||
return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
|
return nativeMin(min + (rand * (max - min + freeParseFloat('1e-' + ((rand + '').length - 1)))), max);
|
||||||
}
|
}
|
||||||
return baseRandom(min, max);
|
return baseRandom(min, max);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user