Files
lodash/internal/baseCreate.js
John-David Dalton 81e41ca0c8 Bump to v3.9.0.
2015-12-16 17:50:42 -08:00

25 lines
604 B
JavaScript

define(['../lang/isObject'], function(isObject) {
/**
* 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.
*/
var baseCreate = (function() {
function object() {}
return function(prototype) {
if (isObject(prototype)) {
object.prototype = prototype;
var result = new object;
object.prototype = null;
}
return result || {};
};
}());
return baseCreate;
});