Ensure snippet in iteratorTemplate is minifiable and remove unneeded references from iteratorTemplate.

Former-commit-id: f8c96f63f1a50644c0d2074e5419e68d1a247d46
This commit is contained in:
John-David Dalton
2013-05-14 09:14:58 -07:00
parent d76ce85327
commit bad40b6125
2 changed files with 6 additions and 7 deletions

View File

@@ -32,7 +32,6 @@
'nonEnum',
'nonEnumProps',
'object',
'objectClass',
'objectProto',
'objectTypes',
'ownIndex',

View File

@@ -568,8 +568,8 @@
// define conditions used in the loop
' <%' +
' var conditions = [];' +
' if (support.enumPrototypes) { conditions.push("!(skipProto && index == \'prototype\')"); }' +
' if (support.enumErrorProps) { conditions.push("!(skipErrorProps && (index == \'message\' || index == \'name\'))"); }' +
' if (support.enumPrototypes) { conditions.push(\'!(skipProto && index == "prototype")\'); }' +
' if (support.enumErrorProps) { conditions.push(\'!(skipErrorProps && (index == "message" || index == "name"))\'); }' +
' %>' +
// iterate own properties using `Object.keys`
@@ -826,15 +826,15 @@
// create the function factory
var factory = Function(
'ctorByClass, errorClass, errorProto, hasOwnProperty, isArguments, ' +
'isArray, isString, keys, lodash, objectClass, objectProto, objectTypes, ' +
'nonEnumProps, stringClass, stringProto, toString',
'isArray, isString, keys, lodash, objectProto, objectTypes, nonEnumProps, ' +
'stringClass, stringProto, toString',
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
);
// return the compiled function
return factory(
ctorByClass, errorClass, errorProto, hasOwnProperty, isArguments,
isArray, isString, keys, lodash, objectClass, objectProto, objectTypes,
nonEnumProps, stringClass, stringProto, toString
isArray, isString, keys, lodash, objectProto, objectTypes, nonEnumProps,
stringClass, stringProto, toString
);
}