* @public
(RootClass, mandatoryMethods)
| 12242 | * @public |
| 12243 | */ |
| 12244 | function enableClassExtend(RootClass, mandatoryMethods) { |
| 12245 | |
| 12246 | RootClass.$constructor = RootClass; |
| 12247 | RootClass.extend = function (proto) { |
| 12248 | |
| 12249 | if (__DEV__) { |
| 12250 | each$1(mandatoryMethods, function (method) { |
| 12251 | if (!proto[method]) { |
| 12252 | console.warn( |
| 12253 | 'Method `' + method + '` should be implemented' |
| 12254 | + (proto.type ? ' in ' + proto.type : '') + '.' |
| 12255 | ); |
| 12256 | } |
| 12257 | }); |
| 12258 | } |
| 12259 | |
| 12260 | var superClass = this; |
| 12261 | var ExtendedClass = function () { |
| 12262 | if (!proto.$constructor) { |
| 12263 | superClass.apply(this, arguments); |
| 12264 | } |
| 12265 | else { |
| 12266 | proto.$constructor.apply(this, arguments); |
| 12267 | } |
| 12268 | }; |
| 12269 | |
| 12270 | extend(ExtendedClass.prototype, proto); |
| 12271 | |
| 12272 | ExtendedClass.extend = this.extend; |
| 12273 | ExtendedClass.superCall = superCall; |
| 12274 | ExtendedClass.superApply = superApply; |
| 12275 | inherits(ExtendedClass, this); |
| 12276 | ExtendedClass.superClass = superClass; |
| 12277 | |
| 12278 | return ExtendedClass; |
| 12279 | }; |
| 12280 | } |
| 12281 | |
| 12282 | var classBase = 0; |
| 12283 |
no test coverage detected