-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdin_min.js
7 lines (7 loc) · 1.27 KB
/
din_min.js
1
2
3
4
5
6
7
/*
* Din - A JavaScript Double Inheritance Framework
* by Kambfhase
* v0.1.4
* MIT License
*/
var Class=function(a){"use strict";function c(d,e,f){var g=a.getOwnPropertyNames(d),h=g.length,i,j=b(d),k=c.skip;while(h--)i=g[h],(!j||!~k.indexOf(i))&&e.call(f,d[i],i,d)}function b(a){return typeof a=="function"};c.skip=a.getOwnPropertyNames(function(){}).concat(["prototype"]);var d={create:function(b){var d=function h(){return h.create.apply(h,arguments)},e=b.parent,f=b["static"],g=b.instance;e&&c(e,function(b,c){a.defineProperty(d,c,a.getOwnPropertyDescriptor(e,c))}),f&&a.defineProperties(d,f),d.prototype=a.create(e&&e.prototype||a.prototype,g),a.defineProperty(d.prototype,"constructor",{value:d,enumerable:!1,configurable:!0,writable:!0}),d.create||(d.create=function(){return a.create(this.prototype)}),d.is||(d.is=function(a){return this.prototype.isPrototypeOf(a)});return d},toPropertyDescriptorMap:function(b){var d={};c(b,function(c,e){d[e]=a.getOwnPropertyDescriptor(b,e)});return d},addSuper:function(a,d){var e=a.parent,f=a["static"],g=a.instance;d=d||"super";if(!e)return a;f&&c(f,function(a,c){var f=a.value;f&&b(f)&&(f[d]=e[c])}),g&&c(g,function(a,c){var f=a.value;f&&b(f)&&(f[d]=e.prototype[c])});return a}};return d.create({"static":d.toPropertyDescriptorMap(d)})}(Object);