1 | var inherits;
|
2 | if (typeof Object.create === 'function'){
|
3 | inherits = function inherits(ctor, superCtor) {
|
4 |
|
5 | ctor.super_ = superCtor
|
6 | ctor.prototype = Object.create(superCtor.prototype, {
|
7 | constructor: {
|
8 | value: ctor,
|
9 | enumerable: false,
|
10 | writable: true,
|
11 | configurable: true
|
12 | }
|
13 | });
|
14 | };
|
15 | } else {
|
16 | inherits = function inherits(ctor, superCtor) {
|
17 | ctor.super_ = superCtor
|
18 | var TempCtor = function () {}
|
19 | TempCtor.prototype = superCtor.prototype
|
20 | ctor.prototype = new TempCtor()
|
21 | ctor.prototype.constructor = ctor
|
22 | }
|
23 | }
|
24 |
|
25 | export default inherits;
|
26 |
|
27 |
|