11 lines
255 B
JavaScript
11 lines
255 B
JavaScript
module.exports.create = (function () {
|
|
function F() {};
|
|
|
|
return function (o) {
|
|
if (arguments.length != 1) {
|
|
throw new Error('Object.create implementation only accepts one parameter.');
|
|
}
|
|
F.prototype = o;
|
|
return new F();
|
|
}
|
|
})(); |