Bump to v3.9.3.

This commit is contained in:
jdalton
2015-05-25 16:15:25 -07:00
parent 314048b069
commit 10d5566cf2
4 changed files with 19 additions and 14 deletions

View File

@@ -1,3 +1,6 @@
/** Used to detect unsigned integer values. */
var reIsUint = /^\d+$/;
/**
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* of an array-like value.
@@ -13,7 +16,7 @@ var MAX_SAFE_INTEGER = 9007199254740991;
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = typeof value == 'number' ? value : parseFloat(value);
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}