mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Ensure the build removes properties in expressions from createIterator.
Former-commit-id: 6e06397c6dd4e7c550667bc364faad565d0244cd
This commit is contained in:
7
build.js
7
build.js
@@ -1638,7 +1638,7 @@
|
||||
}
|
||||
// remove data object property assignment
|
||||
var modified = snippet.replace(RegExp("^(?: *\\/\\/.*\\n)* *(\\w+)\\." + identifier + " *= *(.+\\n+)", 'm'), function(match, object, postlude) {
|
||||
return RegExp('\\b' + object + '\\.').test(postlude) ? postlude : '';
|
||||
return RegExp('\\b' + object + '\\.').test(postlude) ? postlude : '\n';
|
||||
});
|
||||
|
||||
source = source.replace(snippet, function() {
|
||||
@@ -1651,7 +1651,7 @@
|
||||
// remove `factory` arguments
|
||||
source = source.replace(snippet, function(match) {
|
||||
return match
|
||||
.replace(RegExp('\\b' + identifier + '\\b,? *', 'g'), '')
|
||||
.replace(RegExp("[^\\n(,']*?\\b" + identifier + "[^\\n),']*(?:, *)?", 'g'), ' ')
|
||||
.replace(/, *(?=',)/, '')
|
||||
.replace(/,(?=\s*\))/, '');
|
||||
});
|
||||
@@ -1807,6 +1807,7 @@
|
||||
* @returns {String} Returns the modified source.
|
||||
*/
|
||||
function removeKeysOptimization(source) {
|
||||
source = removeFromCreateIterator(source, 'keys');
|
||||
source = removeFromCreateIterator(source, 'useKeys');
|
||||
|
||||
// remove optimized branch in `iteratorTemplate`
|
||||
@@ -3727,7 +3728,7 @@
|
||||
}
|
||||
}
|
||||
// add Underscore's chaining functions
|
||||
if (isUnderscore ? !_.contains(plusFuncs, 'chain') : _.contains(plusFuncs, 'chain')) {
|
||||
if (_.contains(plusFuncs, 'chain') == !isUnderscore) {
|
||||
source = addUnderscoreChaining(source);
|
||||
}
|
||||
// replace `basicEach` references with `forEach` and `forOwn`
|
||||
|
||||
Reference in New Issue
Block a user