Hilo/build/commonjs/core/Class.min.js
2022-06-29 10:45:02 +08:00

6 lines
1.3 KiB
JavaScript

/**
* hilojs 2.0.3 for commonjs
* Copyright 2016 alibaba.com
* Licensed under the MIT License
*/
var Class=function(){var t,r,e=function(t){t=t||{};var r=t.hasOwnProperty("constructor")?t.constructor:function(){};return n.call(r,t),r},n=function(t){var r,e,n={};for(r in t)e=t[r],o.hasOwnProperty(r)?o[r].call(this,e):n[r]=e;c(this.prototype,n)},o={Extends:function(t){var r=this.prototype,e=i(t.prototype);c(this,t),c(e,r),e.constructor=this,this.prototype=e,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var r,e=this.prototype;r=t.shift();)c(e,r.prototype||r)},Statics:function(t){c(this,t)}},i=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(r){return t.prototype=r,new t}}(),c=function(t){for(var e=1,n=arguments.length;e<n;e++){var o,i=arguments[e];for(var c in i){var u=i[c];!u||"object"!=typeof u||void 0===u.value&&"function"!=typeof u.get&&"function"!=typeof u.set?t[c]=u:(o=o||{},o[c]=u)}o&&r(t,o)}return t};try{t=Object.defineProperty,r=Object.defineProperties,t({},"$",{value:0})}catch(u){"__defineGetter__"in Object&&(t=function(t,r,e){return"value"in e&&(t[r]=e.value),"get"in e&&t.__defineGetter__(r,e.get),"set"in e&&t.__defineSetter__(r,e.set),t},r=function(r,e){for(var n in e)e.hasOwnProperty(n)&&t(r,n,e[n]);return r})}return{create:e,mix:c}}();module.exports=Class;