Remove unneeded variable references.

Former-commit-id: ab2f5f4408db25dc63b5d85b4adf156f9f978711
This commit is contained in:
John-David Dalton
2012-05-23 00:52:39 -04:00
parent b38947146e
commit f8af24b383
2 changed files with 7 additions and 17 deletions

View File

@@ -8,33 +8,24 @@
/** Used to minify variables embedded in compiled strings */ /** Used to minify variables embedded in compiled strings */
var compiledVars = [ var compiledVars = [
'accumulator', 'accumulator',
'args',
'array',
'arrayClass', 'arrayClass',
'bind', 'bind',
'callback', 'callback',
'className', 'className',
'collection', 'collection',
'concat',
'ctor', 'ctor',
'false', 'false',
'funcClass', 'funcClass',
'hasOwnProperty', 'hasOwnProperty',
'identity', 'identity',
'index', 'index',
'indexOf',
'isArray',
'isEmpty',
'isFunc',
'length', 'length',
'object', 'object',
'objectTypes', 'objectTypes',
'noaccum', 'noaccum',
'prop',
'property', 'property',
'result', 'result',
'skipProto', 'skipProto',
'slice',
'source', 'source',
'sourceIndex', 'sourceIndex',
'stringClass', 'stringClass',
@@ -177,7 +168,6 @@
'throttle', 'throttle',
'times', 'times',
'toArray', 'toArray',
'toArray',
'union', 'union',
'uniq', 'uniq',
'unique', 'unique',

View File

@@ -391,8 +391,8 @@
'exit': '', 'exit': '',
'init': '', 'init': '',
'top': '', 'top': '',
'arrayBranch': { 'loopExp': '++index < length' }, 'arrayBranch': { 'beforeLoop': '', 'loopExp': '++index < length' },
'objectBranch': {} 'objectBranch': { 'beforeLoop': '' }
}; };
while (++index < length) { while (++index < length) {
@@ -427,7 +427,7 @@
data.useHas = data.useHas !== false; data.useHas = data.useHas !== false;
if (!data.exit) { if (!data.exit) {
data.exit = 'if (' + firstArg + ' == null) return result'; data.exit = 'if (!' + firstArg + ') return result';
} }
if (firstArg == 'object' || !arrayBranch.inLoop) { if (firstArg == 'object' || !arrayBranch.inLoop) {
data.arrayBranch = null; data.arrayBranch = null;
@@ -437,14 +437,14 @@
} }
// create the function factory // create the function factory
var factory = Function( var factory = Function(
'arrayClass, bind, concat, funcClass, hasOwnProperty, identity, indexOf, ' + 'arrayClass, bind, funcClass, hasOwnProperty, identity, objectTypes, ' +
'isArray, isEmpty, objectTypes, slice, stringClass, toString, undefined', 'stringClass, toString, undefined',
'"use strict"; return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' '"use strict"; return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
); );
// return the compiled function // return the compiled function
return factory( return factory(
arrayClass, bind, concat, funcClass, hasOwnProperty, identity, indexOf, arrayClass, bind, funcClass, hasOwnProperty, identity, objectTypes,
isArray, isEmpty, objectTypes, slice, stringClass, toString stringClass, toString
); );
} }