From d6d01cdfa034e6c2d22b2c2b2061ed0855a27bc8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 23 Sep 2016 18:37:54 -0700 Subject: [PATCH] Remove the need for es-sham. --- lodash.js | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/lodash.js b/lodash.js index 10ee40f9d5..c27638b247 100644 --- a/lodash.js +++ b/lodash.js @@ -1657,6 +1657,30 @@ return new LodashWrapper(value); } + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = prototype; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + /** * The function whose prototype chain sequence wrappers inherit from. * @@ -2690,18 +2714,6 @@ return true; } - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; - } - /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`.