Merge branch 'master' of github.com:bestiejs/lodash

Former-commit-id: 699fbdc06c27cfec9d0f7b9809921f81884948f1
This commit is contained in:
Blaine Bublitz
2013-07-14 13:40:43 -07:00
2 changed files with 11 additions and 5 deletions

View File

@@ -902,7 +902,7 @@
(function() {
var deps = _.invoke(categories, 'toLowerCase'),
depArgs = deps.join(', '),
depPaths = "['" + deps.join("', './") + "'], ",
depPaths = "['" + (deps.length ? './' + deps.join("', './") : '') + "'], ",
iife = [];
if (isAMD) {

View File

@@ -331,6 +331,11 @@
'sortBy'
];
var depObjProps = [
'isEqual',
'keys'
];
var props = [
'cache',
'criteria',
@@ -339,18 +344,19 @@
];
// minify `dependencyObject` properties
source = source.replace(/\b(dependencyObject(?:\.|\['))\w+/g, function(match, prelude) {
return prelude + minNames[iteratorOptions.length + props.length];
depObjProps.forEach(function(prop, index) {
source = source.replace(RegExp("\\b(dependencyObject(?:\\.|\\['))" + prop + '\\b', 'g'), function(match, prelude) {
return prelude + minNames[iteratorOptions.length + props.length + index];
});
});
// minify other properties used in functions
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + funcNames.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
if (!snippets) {
return;
}
snippets.forEach(function(snippet) {
var modified = snippet;
// minify properties
props.forEach(function(prop, index) {
// use minified names different than those chosen for `iteratorOptions`
var minName = minNames[iteratorOptions.length + index],