(cls, superCtor, statics, prototype)
| 2 | |
| 3 | // useful stuff |
| 4 | const inherits = function(cls, superCtor, statics, prototype) { |
| 5 | // eslint-disable-next-line no-underscore-dangle |
| 6 | cls.super_ = superCtor; |
| 7 | |
| 8 | if (!prototype) { |
| 9 | prototype = statics; |
| 10 | statics = null; |
| 11 | } |
| 12 | |
| 13 | if (statics) { |
| 14 | Object.keys(statics).forEach(i => { |
| 15 | Object.defineProperty(cls, i, Object.getOwnPropertyDescriptor(statics, i)); |
| 16 | }); |
| 17 | } |
| 18 | |
| 19 | const properties = { |
| 20 | constructor: { |
| 21 | value: cls, |
| 22 | enumerable: false, |
| 23 | writable: false, |
| 24 | configurable: true, |
| 25 | }, |
| 26 | }; |
| 27 | if (prototype) { |
| 28 | Object.keys(prototype).forEach(i => { |
| 29 | properties[i] = Object.getOwnPropertyDescriptor(prototype, i); |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | cls.prototype = Object.create(superCtor.prototype, properties); |
| 34 | }; |
| 35 | |
| 36 | // eslint-disable-next-line no-control-regex |
| 37 | const xmlDecodeRegex = /[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/; |
nothing calls this directly
no test coverage detected
searching dependent graphs…