00001 var isObject = require('./isObject'); 00002 00004 var objectCreate = Object.create; 00005 00014 var baseCreate = (function() { 00015 function object() {} 00016 return function(proto) { 00017 if (!isObject(proto)) { 00018 return {}; 00019 } 00020 if (objectCreate) { 00021 return objectCreate(proto); 00022 } 00023 object.prototype = proto; 00024 var result = new object; 00025 object.prototype = undefined; 00026 return result; 00027 }; 00028 }()); 00029 00030 module.exports = baseCreate;