forked from WebReflection/classtrophobic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasstrophobic.min.js
1 lines (1 loc) · 1.86 KB
/
classtrophobic.min.js
1
/*! (C) 2017 Andrea Giammarchi - MIT Style License */const Class=((a,b)=>{'use strict';const c=b.get,e=b.set,f=b.ownKeys,g=b.defineProperty,h=b.construct,i=a.getPrototypeOf,j=a.setPrototypeOf,l=a.defineProperties,m=a.getOwnPropertyDescriptor,n={apply:(u,w,x)=>b.apply(u.self,w,x),construct:(u,w,x)=>h(u.self,w,x),defineProperty:(u,w,x)=>g(u.self,w,x),deleteProperty:(u,w)=>b.deleteProperty(u.self,w),get:(u,w,x)=>{if('super'===w&&!('self'in u))return function(){return u.self=h(u.super,arguments,u.class)};const y=c(u.self,w);return'function'==typeof y?function(){return y.apply(this===x?u.self:this,arguments)}:y},getOwnPropertyDescriptor:(u,w)=>m(u.self,w),getPrototypeOf:u=>i(u.self),has:(u,w)=>b.has(u.self,w),isExtensible:u=>b.isExtensible(u.self),ownKeys:u=>f(u.self),preventExtensions:u=>b.preventExtensions(u.self),set:(u,w,x)=>e(u.self,w,x),setPrototypeOf:(u,w)=>j(u.self,w)},o={get:(u,w)=>function(){const x=i(u),y=x[w];let z,A=x;do A=i(A);while(y===A[w]);try{z=A[w].apply(j(u,A),arguments)}finally{j(u,x)}return z}},q={get:(u,w)=>function(){const x=i(u),y=u[w];let z,A=x;for(;y===A[w];)A=i(A);u.method=A[w];try{z=u.method.apply(j(u,i(A)),arguments)}finally{j(u,x).method=y}return z}},s=new Set(['constructor','extends','static']);return function(w){const x=w.constructor,y=w.static,z=w.extends,A=w.hasOwnProperty('constructor')?z?class extends z{constructor(){const E=D?function(){}:{};return E.super=z,E.class=A,x.apply(new Proxy(E,n),arguments)||E.self}}:class{constructor(){return x.apply(this,arguments)||this}}:z?class extends z{}:class{},B=z?{super:{get(){return new Proxy(A,q)}}}:{},C=z?{super:{get(){return new Proxy(this,o)}}}:{},D=!!z&&Function.prototype.isPrototypeOf(z);return f(w).filter(E=>!s.has(E)).forEach(E=>{C[E]=m(w,E),C[E].enumerable=!1}),l(A.prototype,C),y&&f(y).forEach(E=>{B[E]=m(y,E),B[E].enumerable=!1}),l(A,B)}})(Object,Reflect);try{module.exports=Class}catch(a){}