Remove isKeysFast guard.

Former-commit-id: 38a63ed31d652fd198ebf30dbb0f1546160c30c1
This commit is contained in:
John-David Dalton
2013-01-05 10:14:15 -08:00
parent e2c2a37221
commit 766d67d80d
7 changed files with 61 additions and 67 deletions

View File

@@ -173,7 +173,7 @@
'bottom',
'firstArg',
'hasDontEnumBug',
'isKeysFast',
'isKeysNative',
'loop',
'nonEnumArgs',
'noCharByIndex',
@@ -889,16 +889,14 @@
* @returns {String} Returns the modified source.
*/
function removeKeysOptimization(source) {
source = removeVar(source, 'isKeysFast');
// remove optimized branch in `iteratorTemplate`
source = source.replace(getIteratorTemplate(source), function(match) {
return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(isKeysFast[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/, "'\\n' +\n$2");
return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(isKeysNative[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/, "'\\n' +\n$2");
});
// remove data object property assignment in `createIterator`
source = source.replace(matchFunction(source, 'createIterator'), function(match) {
return match.replace(/ *'isKeysFast':.+\n/, '');
return match.replace(/ *'isKeysNative':.+\n/, '');
});
return source;
@@ -1382,7 +1380,7 @@
source = setUseStrictOption(source, isStrict);
if (isLegacy) {
_.each(['getPrototypeOf', 'isBindFast', 'isKeysFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) {
_.each(['getPrototypeOf', 'isBindFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) {
source = replaceVar(source, varName, 'false');
});
@@ -1401,9 +1399,10 @@
// remove `_.templateSettings.imports assignment
source = source.replace(/,[^']*'imports':[^}]+}/, '');
// remove large array optimizations
// remove large array and keys optimizations
source = removeFunction(source, 'cachedContains');
source = removeVar(source, 'largeArraySize');
source = removeKeysOptimization(source);
// replace `_.assign`
source = replaceFunction(source, 'assign', [
@@ -1700,8 +1699,6 @@
}
}
if (isMobile) {
source = replaceVar(source, 'isKeysFast', 'false');
source = removeKeysOptimization(source);
source = removeNoNodeClass(source);
// remove `prototype` [[Enumerable]] fix from `_.keys`