-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinherit-min.js
1 lines (1 loc) · 930 Bytes
/
inherit-min.js
1
if (Function.prototype.$inherits || Function.prototype.$extend) { if (typeof console !== "undefined" && typeof console.warn === "function") { console.warn("The functions $inherits and $extend are already defined in Function.prototype. The library is going to overwrite them.") } } Function.prototype.$inherits = function (e) { this.prototype = new e; var t = {}, n = this.prototype; this.prototype.constructor = e; this.prototype.uber = function (i) { if (!(i in t)) { t[i] = 0 } var s, o, u = t[i], a = e.prototype; if (u) { while (u) { a = a.constructor.prototype; u -= 1 } s = a[i] } else { s = n[i]; if (s == this[i]) { s = a[i] } } t[i] += 1; o = s.apply(this, Array.prototype.slice.apply(arguments, [1])); t[i] -= 1; return o }; return this }; Function.prototype.$extend = function (e) { var t = function () { this.initialize.apply(this, arguments) }; t.$inherits(this); for (var n in e) { t.prototype[n] = e[n] } return t }