(protoProps, staticProps)
| 4 | @hide |
| 5 | */ |
| 6 | export default function extend(protoProps, staticProps) { |
| 7 | class Child extends this { |
| 8 | constructor(...args) { |
| 9 | super(...args); |
| 10 | // The constructor function for the new subclass is optionally defined by you |
| 11 | // in your `extend` definition |
| 12 | if (protoProps && has(protoProps, "constructor")) { |
| 13 | protoProps.constructor.call(this, ...args); |
| 14 | } |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // Add static properties to the constructor function, if supplied. |
| 19 | |
| 20 | Object.assign(Child, this, staticProps); |
| 21 | |
| 22 | // Add prototype properties (instance properties) to the subclass, |
| 23 | // if supplied. |
| 24 | if (protoProps) { |
| 25 | Object.assign(Child.prototype, protoProps); |
| 26 | } |
| 27 | |
| 28 | return Child; |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…