From 8e30fe294691c769c183c808433064beb9bbc78d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Feb 2013 01:54:35 -0800 Subject: [PATCH] Fix build. Former-commit-id: 41b9584b63962a71f146c61fda056d15a2be4e14 --- build.js | 17 ++++++++++------- test/test-build.js | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/build.js b/build.js index 62377b6ba..eb9a5161b 100755 --- a/build.js +++ b/build.js @@ -131,7 +131,7 @@ 'memoize': [], 'merge': ['forEach', 'forOwn', 'isArray', 'isObject', 'isPlainObject'], 'min': ['isArray', 'isEqual', 'isString', 'keys'], - 'mixin': ['forEach', 'forOwn', 'functions'], + 'mixin': ['forEach', 'functions'], 'noConflict': [], 'object': [], 'omit': ['forIn', 'indexOf'], @@ -163,7 +163,7 @@ 'union': ['uniq'], 'uniq': ['indexOf', 'isEqual', 'keys'], 'uniqueId': [], - 'value': [], + 'value': ['forOwn'], 'values': ['keys'], 'where': ['filter'], 'without': ['indexOf'], @@ -983,9 +983,12 @@ // grab the method assignments snippet snippet = getMethodAssignments(source); + // remove method assignment from `lodash.prototype` + source = source.replace(RegExp('^ *lodash\\.prototype\\.' + funcName + ' *=.+\\n', 'm'), ''); + // remove assignment and aliases var modified = getAliases(funcName).concat(funcName).reduce(function(result, otherName) { - return result.replace(RegExp('^(?: *//.*\\s*)* *lodash\\.' + otherName + ' *= *.+\\n', 'm'), ''); + return result.replace(RegExp('^(?: *//.*\\s*)* *lodash\\.' + otherName + ' *=.+\\n', 'm'), ''); }, snippet); // replace with the modified snippet @@ -2265,16 +2268,16 @@ modified = snippet; if (!exposeAssign) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.assign *= *.+\n/m, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.assign *=.+\n/m, ''); } if (!exposeForIn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forIn *= *.+\n/m, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forIn *=.+\n/m, ''); } if (!exposeForOwn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/m, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forOwn *=.+\n/m, ''); } if (!exposeIsPlainObject) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/m, ''); + modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.isPlainObject *=.+\n/m, ''); } source = source.replace(snippet, function() { return modified; diff --git a/test/test-build.js b/test/test-build.js index 17158e25e..f88152fbe 100644 --- a/test/test-build.js +++ b/test/test-build.js @@ -1101,7 +1101,7 @@ if (index) { equal(typeof lodash.prototype.x, 'function', basename); } else { - equal('x' in lodash.prototype.x, false, basename); + equal('x' in lodash.prototype, false, basename); } start(); });