From 956141498500b3e3559eab3db9a793edca99d7f3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 17 Jul 2013 08:34:33 -0700 Subject: [PATCH] Ensure the build removes properties in expressions from `createIterator`. Former-commit-id: 6e06397c6dd4e7c550667bc364faad565d0244cd --- build.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index 913ba8a70..1ca732523 100644 --- a/build.js +++ b/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`