1. if (typeof Object.create !== 'function') {
    2. Object.create = function (proto, propertiesObject) {
    3. if (typeof proto !== 'object' && typeof proto !== 'function') {
    4. throw new TypeError('Object prototype may only be an Object: ' + proto)
    5. } else if (proto === null) {
    6. throw new Error('This browser\'s implementation of Object.create is a shim and doesn\'t support \'null\' as the first argument.')
    7. }
    8. function F () {
    9. }
    10. F.prototype = proto
    11. if (propertiesObject) {
    12. Object.defineProperties(F, propertiesObject)
    13. }
    14. return new F()
    15. }
    16. }