From 56ff8755d480beb44d9201cb434fbc0ce6fb72d9 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 24 Jul 2013 22:54:55 -0700 Subject: [PATCH] Update `_.createCallback` dependencies and fix typo in `removeFromCreateIterator`. Former-commit-id: 8478aadcdcb3fbf30a481de1bc515510959a2396 --- build.js | 4 ++-- build/pre-compile.js | 7 +------ dist/lodash.compat.js | 2 +- dist/lodash.js | 2 +- dist/lodash.underscore.js | 2 +- lodash.js | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/build.js b/build.js index be003bb61..8868f69c7 100644 --- a/build.js +++ b/build.js @@ -104,7 +104,7 @@ 'compose': [], 'contains': ['baseEach', 'getIndexOf', 'isString'], 'countBy': ['createCallback', 'forEach'], - 'createCallback': ['bind', 'identity', 'isEqual', 'isObject', 'keys', 'setBindData'], + 'createCallback': ['baseIsEqual', 'bind', 'identity', 'isObject', 'keys', 'setBindData'], 'debounce': ['isObject'], 'defaults': ['createCallback', 'createIterator'], 'defer': ['bind'], @@ -1670,7 +1670,7 @@ // remove `factory` arguments source = source.replace(snippet, function(match) { return match - .replace(RegExp("[^\\n(,']*?\\b" + identifier + "[^\\n),']*(?:, *)?", 'g'), ' ') + .replace(RegExp("[^\\n(,']*?\\b" + identifier + "\\b[^\\n),']*(?:, *)?", 'g'), ' ') .replace(/, *(?=',)/, '') .replace(/,(?=\s*\))/, ''); }); diff --git a/build/pre-compile.js b/build/pre-compile.js index 707e01f87..342fda376 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -357,12 +357,7 @@ // match `baseUniq`, `cachePush`, `createCache`, `createIterator`, `getObject`, and `releaseObject` functions '^( *)(?:var|function) +(?:baseUniq|cachePush|createCache|createIterator|getObject|releaseObject)\\b[\\s\\S]+?\\n\\3}' ].join('|'), 'gm') - ); - - // exit early if no compilable snippets - if (!snippets) { - return source; - } + ) || []; snippets.forEach(function(snippet, index) { var isFunc = /\bfunction *[ \w]*\(/.test(snippet), diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 459f8e949..1a723b18f 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -4259,7 +4259,7 @@ end = start; start = 0; } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // use `Array(length)` so engines, like Chakra and V8, avoid slower modes // http://youtu.be/XAqIpGU8ZZk#t=17m25s var index = -1, length = nativeMax(0, ceil((end - start) / step)), diff --git a/dist/lodash.js b/dist/lodash.js index c2f2e1124..a31d7e440 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -3936,7 +3936,7 @@ end = start; start = 0; } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // use `Array(length)` so engines, like Chakra and V8, avoid slower modes // http://youtu.be/XAqIpGU8ZZk#t=17m25s var index = -1, length = nativeMax(0, ceil((end - start) / step)), diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index f4c07fbe4..8e07f85d6 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -2995,7 +2995,7 @@ end = start; start = 0; } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // use `Array(length)` so engines, like Chakra and V8, avoid slower modes // http://youtu.be/XAqIpGU8ZZk#t=17m25s var index = -1, length = nativeMax(0, ceil((end - start) / step)), diff --git a/lodash.js b/lodash.js index 0dba1c6cc..dcd2563ae 100644 --- a/lodash.js +++ b/lodash.js @@ -4297,7 +4297,7 @@ end = start; start = 0; } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // use `Array(length)` so engines, like Chakra and V8, avoid slower modes // http://youtu.be/XAqIpGU8ZZk#t=17m25s var index = -1, length = nativeMax(0, ceil((end - start) / step)),