From bf508e453eb8673fa1ea273b0f8d40b6a3146c1b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 16 Aug 2012 21:19:47 -0700 Subject: [PATCH] Remove unused `funcClass` variable from compiled functions. Former-commit-id: f47b8e412b5151e69a3ab78f03243c461b5ab072 --- build/pre-compile.js | 1 - lodash.js | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/pre-compile.js b/build/pre-compile.js index 6fb2cedde..b1646a5ad 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -11,7 +11,6 @@ 'collection', 'concat', 'ctor', - 'funcClass', 'hasOwnProperty', 'identity', 'index', diff --git a/lodash.js b/lodash.js index e77701466..5f2327b43 100644 --- a/lodash.js +++ b/lodash.js @@ -662,18 +662,18 @@ // create the function factory var factory = Function( 'arrayLikeClasses, ArrayProto, bind, compareAscending, concat, forIn, ' + - 'funcClass, hasOwnProperty, identity, indexOf, isArguments, isArray, ' + - 'isFunction, isPlainObject, iteratorBind, objectClass, objectTypes, ' + - 'nativeKeys, propertyIsEnumerable, slice, stringClass, toString', + 'hasOwnProperty, identity, indexOf, isArguments, isArray, isFunction, ' + + 'isPlainObject, iteratorBind, objectClass, objectTypes, nativeKeys, ' + + 'propertyIsEnumerable, slice, stringClass, toString', 'var callee = function(' + args + ') {\n' + iteratorTemplate(data) + '\n};\n' + 'return callee' ); // return the compiled function return factory( arrayLikeClasses, ArrayProto, bind, compareAscending, concat, forIn, - funcClass, hasOwnProperty, identity, indexOf, isArguments, isArray, - isFunction, isPlainObject, iteratorBind, objectClass, objectTypes, - nativeKeys, propertyIsEnumerable, slice, stringClass, toString + hasOwnProperty, identity, indexOf, isArguments, isArray, isFunction, + isPlainObject, iteratorBind, objectClass, objectTypes, nativeKeys, + propertyIsEnumerable, slice, stringClass, toString ); } @@ -735,7 +735,9 @@ } /** - * Checks if `value` is a plain `Object` object with `Object` as its constructor. + * Checks if a given `value` is an object created by the `Object` constructor + * assuming objects created by the `Object` constructor have no inherited + * enumerable properties and that there are no `Object.prototype` extensions. * * @private * @param {Mixed} value The value to check.