mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Avoid incorrectly converting local variables to boolean values.
Former-commit-id: 322f6dec4c669bdc1ef534f7786cf12aee580e53
This commit is contained in:
4
build.js
4
build.js
@@ -2221,7 +2221,7 @@
|
||||
}
|
||||
return match.replace(/^(( *)if *\(.*?\bisArray\([^\)]+\).*?\) *{\n)(( *)var index[^;]+.+\n+)/m, function(snippet, statement, indent, vars) {
|
||||
vars = vars
|
||||
.replace(/\b(length *=)[^;]+/, '$1 collection' + (methodName == 'reduce' ? '.length' : ' ? collection.length : 0'))
|
||||
.replace(/\b(length *=)[^;=]+/, '$1 collection' + (methodName == 'reduce' ? '.length' : ' ? collection.length : 0'))
|
||||
.replace(RegExp('^ ' + indent, 'gm'), indent);
|
||||
|
||||
return vars + statement.replace(/\bisArray\([^\)]+\)/, "typeof length == 'number'");
|
||||
@@ -3263,7 +3263,7 @@
|
||||
modified = modified
|
||||
.replace(/\bctor *=.+\s+/, '')
|
||||
.replace(/^ *ctor\.prototype.+\s+.+\n/m, '')
|
||||
.replace(/(?:,\n)? *props *=[^;]+/, '')
|
||||
.replace(/(?:,\n)? *props *=[^;=]+/, '')
|
||||
.replace(/^ *for *\((?=prop)/, '$&var ')
|
||||
}
|
||||
if (!/support\.nonEnumArgs *=(?! *(?:false|true))/.test(match)) {
|
||||
|
||||
Reference in New Issue
Block a user