Ali Shakiba 55417918af init
2017-01-14 02:55:26 -05:00

17 lines
442 B
JavaScript

if (typeof Object.create == 'function') {
module.exports = function(proto, props) {
return Object.create.call(Object, proto, props);
};
} else {
module.exports = function(proto, props) {
if (props)
throw Error('Second argument is not supported!');
if (typeof proto !== 'object' || proto === null)
throw Error('Invalid prototype!');
noop.prototype = proto;
return new noop;
};
function noop() {
}
}