mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +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
|
// remove data object property assignment
|
||||||
var modified = snippet.replace(RegExp("^(?: *\\/\\/.*\\n)* *(\\w+)\\." + identifier + " *= *(.+\\n+)", 'm'), function(match, object, postlude) {
|
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() {
|
source = source.replace(snippet, function() {
|
||||||
@@ -1651,7 +1651,7 @@
|
|||||||
// remove `factory` arguments
|
// remove `factory` arguments
|
||||||
source = source.replace(snippet, function(match) {
|
source = source.replace(snippet, function(match) {
|
||||||
return match
|
return match
|
||||||
.replace(RegExp('\\b' + identifier + '\\b,? *', 'g'), '')
|
.replace(RegExp("[^\\n(,']*?\\b" + identifier + "[^\\n),']*(?:, *)?", 'g'), ' ')
|
||||||
.replace(/, *(?=',)/, '')
|
.replace(/, *(?=',)/, '')
|
||||||
.replace(/,(?=\s*\))/, '');
|
.replace(/,(?=\s*\))/, '');
|
||||||
});
|
});
|
||||||
@@ -1807,6 +1807,7 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function removeKeysOptimization(source) {
|
function removeKeysOptimization(source) {
|
||||||
|
source = removeFromCreateIterator(source, 'keys');
|
||||||
source = removeFromCreateIterator(source, 'useKeys');
|
source = removeFromCreateIterator(source, 'useKeys');
|
||||||
|
|
||||||
// remove optimized branch in `iteratorTemplate`
|
// remove optimized branch in `iteratorTemplate`
|
||||||
@@ -3727,7 +3728,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add Underscore's chaining functions
|
// add Underscore's chaining functions
|
||||||
if (isUnderscore ? !_.contains(plusFuncs, 'chain') : _.contains(plusFuncs, 'chain')) {
|
if (_.contains(plusFuncs, 'chain') == !isUnderscore) {
|
||||||
source = addUnderscoreChaining(source);
|
source = addUnderscoreChaining(source);
|
||||||
}
|
}
|
||||||
// replace `basicEach` references with `forEach` and `forOwn`
|
// replace `basicEach` references with `forEach` and `forOwn`
|
||||||
|
|||||||
Reference in New Issue
Block a user