Revert to compiling _.assign and _.defaults, using isKeysFast, and tweak large array size in _.without.

Former-commit-id: 275d453f49e762ac499a9328ddb8e156b8c9c22d
This commit is contained in:
John-David Dalton
2013-01-23 23:58:34 -08:00
parent dd9baa1502
commit 9f7319cff4
8 changed files with 279 additions and 267 deletions

View File

@@ -7,23 +7,29 @@
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'argsIndex',
'argsLength',
'callback',
'collection',
'createCallback',
'ctor',
'guard',
'hasOwnProperty',
'index',
'isArguments',
'isArray',
'isString',
'iteratee',
'length',
'nativeKeys',
'object',
'objectTypes',
'ownIndex',
'ownProps',
'propertyIsEnumerable',
'result',
'skipProto',
'source',
'thisArg'
];
@@ -34,14 +40,13 @@
'bottom',
'firstArg',
'hasDontEnumBug',
'isKeysNative',
'isKeysFast',
'loop',
'nonEnumArgs',
'noCharByIndex',
'shadowed',
'top',
'useHas',
'useStrict'
'useHas'
];
/** Used to minify variables and string values to a single character */
@@ -328,11 +333,6 @@
: modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'");
});
if (isCreateIterator) {
// clip after the `data` object assignment to avoid minifying its values
source = source.replace(snippet, modified);
snippet = modified = modified.replace(/^[\s\S]+?data *= *{[^}]+}.+/, '');
}
// minify snippet variables / arguments
compiledVars.forEach(function(variable, index) {
var minName = minNames[index];