From 1b27834c41a652b456b1a8064a5ab5774682ef62 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 9 Feb 2013 19:36:10 -0800 Subject: [PATCH] Move `_.isArguments` fallback `noArgsClass` work into `removeNoArgsClass` in build.js. Former-commit-id: 3627e59c65b67a61fc5ee04166004e400d816d13 --- build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.js b/build.js index ee2f95329..3506c072d 100755 --- a/build.js +++ b/build.js @@ -716,7 +716,7 @@ * @returns {String} Returns the `isArguments` fallback. */ function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0]; + return (source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:noArgsClass|!isArguments)[\s\S]+?};\n\1}/) || [''])[0]; } /** @@ -1064,6 +1064,11 @@ function removeNoArgsClass(source) { source = removeVar(source, 'noArgsClass'); + // replace `noArgsClass` in the `_.isArguments` fallback + source = source.replace(getIsArgumentsFallback(source), function(match) { + return match.replace(/noArgsClass/g, '!isArguments(arguments)'); + }); + // remove `noArgsClass` from `_.isEmpty` source = source.replace(matchFunction(source, 'isEmpty'), function(match) { return match.replace(/ *\|\| *\(noArgsClass *&&[^)]+?\)\)/g, ''); @@ -2185,11 +2190,6 @@ } }); - // replace `noArgsClass` in the `_.isArguments` fallback - source = source.replace(getIsArgumentsFallback(source), function(match) { - return match.replace(/noArgsClass/g, '!isArguments(arguments)'); - }); - // remove chainability from `each` and `_.forEach` _.each(['each', 'forEach'], function(methodName) { source = source.replace(matchFunction(source, methodName), function(match) {