mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Move regexp used in _.parseInt to outside the method.
Former-commit-id: 5b93dcdff39089ed5467ba52040f2e352716c49e
This commit is contained in:
15
dist/lodash.js
vendored
15
dist/lodash.js
vendored
@@ -33,16 +33,13 @@
|
||||
/** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */
|
||||
var largeArraySize = 30;
|
||||
|
||||
/** Used to match HTML entities */
|
||||
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
||||
|
||||
/** Used to match regexp flags from their coerced string values */
|
||||
var reFlags = /\w*$/;
|
||||
/** Used to match HTML entities */
|
||||
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
@@ -50,9 +47,15 @@
|
||||
*/
|
||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||
|
||||
/** Used to match regexp flags from their coerced string values */
|
||||
var reFlags = /\w*$/;
|
||||
|
||||
/** Used to match "interpolate" template delimiters */
|
||||
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/** Used to match leading zeros to be removed */
|
||||
var reLeadingZeros = /^0+(?=.$)/;
|
||||
|
||||
/** Used to ensure capturing order of template delimiters */
|
||||
var reNoMatch = /($^)/;
|
||||
|
||||
@@ -4535,7 +4538,7 @@
|
||||
*/
|
||||
var parseInt = nativeParseInt('08') == 8 ? nativeParseInt : function(value, radix) {
|
||||
// Firefox and Opera still follow the ES3 specified implementation of `parseInt`
|
||||
return nativeParseInt(isString(value) ? value.replace(/^0+(?=.$)/, '') : value, radix || 0);
|
||||
return nativeParseInt(isString(value) ? value.replace(reLeadingZeros, '') : value, radix || 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user