Bump to v3.10.0.

This commit is contained in:
jdalton
2015-06-14 22:21:58 -07:00
parent 6ee2b9a7b8
commit 4bd2890bbd
121 changed files with 777 additions and 649 deletions

View File

@@ -5,18 +5,6 @@ import trim from './trim';
/** Used to detect hexadecimal string values. */
var reHasHexPrefix = /^0[xX]/;
/** Used to detect and test for whitespace. */
var whitespace = (
// Basic whitespace characters.
' \t\x0b\f\xa0\ufeff' +
// Line terminators.
'\n\r\u2028\u2029' +
// Unicode category "Zs" space separators.
'\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
);
/* Native method references for those with the same name as other `lodash` methods. */
var nativeParseInt = root.parseInt;
@@ -44,25 +32,16 @@ var nativeParseInt = root.parseInt;
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
if (guard && isIterateeCall(string, radix, guard)) {
// Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
// Chrome fails to trim leading <BOM> whitespace characters.
// See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
return nativeParseInt(string, radix);
}
// Fallback for environments with pre-ES5 implementations.
if (nativeParseInt(whitespace + '08') != 8) {
parseInt = function(string, radix, guard) {
// Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
// Chrome fails to trim leading <BOM> whitespace characters.
// See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
string = trim(string);
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
};
string = trim(string);
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
}
export default parseInt;