proto.es5.min.js 1.4 KB

1234
  1. /*! uberproto - v1.2.0 - 2015-11-29
  2. * http://daffl.github.com/uberproto
  3. * Copyright (c) 2015 ; Licensed MIT */
  4. !function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Proto=b()}(this,function(){function a(a,b,c,d){return function(){var e=this._super;this._super="function"==typeof b?b:a[c];var f=d.apply(this,arguments);return this._super=e,f}}function b(b,c){var d,e=c||this,f=/\b_super\b/,g=Object.getPrototypeOf(e)||e.prototype;for(var h in b)d=e[h],e[h]=("function"==typeof b[h]&&"function"==typeof g[h]||"function"==typeof d&&"function"==typeof b[h])&&f.test(b[h])?a(g,d,h,b[h]):b[h];return e}function c(b,c){var d=c||this,e=/\b_super\b/,f=Object.getPrototypeOf(d)||d.prototype,g={},h=b,i=function(a){g[a]||(g[a]=Object.getOwnPropertyDescriptor(h,a))};do Object.getOwnPropertyNames(h).forEach(i);while((h=Object.getPrototypeOf(h))&&Object.getPrototypeOf(h));return Object.keys(g).forEach(function(b){var c=g[b];"function"==typeof c.value&&e.test(c.value)&&(c.value=a(f,d[b],b,c.value)),Object.defineProperty(d,b,c)}),d}return{create:function(){var a=Object.create(this),b="string"==typeof a.__init?a.__init:"init";return"function"==typeof a[b]&&a[b].apply(a,arguments),a},mixin:"function"==typeof Object.defineProperty?c:b,extend:function(a,b){return this.mixin(a,Object.create(b||this))},proxy:function(a){var b=this[a],c=Array.prototype.slice.call(arguments,1);return c.unshift(this),b.bind.apply(b,c)}}});