-
Notifications
You must be signed in to change notification settings - Fork 1
/
justoop.0.1.5.min.js
4 lines (3 loc) · 8.48 KB
/
justoop.0.1.5.min.js
1
2
3
4
/*! justoop 0.1.5 -r 25-08-2016 */
"use strict";!function(){var a,b,c="undefined"!=typeof module;c?(a=module.exports,b=global):("undefined"!=typeof window&&(b=window),a={}),function(a,b){function c(a){var b=[];return q(a,function(a,c){b.push(c)}),b}function d(a){var b=function(){};return f(console)&&(b=function(){try{console[a].apply(console,c(arguments))}catch(a){var b=c(arguments).join(" ");console.log(b)}}),b}function e(a,b){if(!a){var b=Array.prototype.slice.call(arguments,1),c=b.join(" ");throw L(c),new Error(c||"assertion fail")}}function f(a){return!g(a)}function g(a){return"undefined"==typeof a}function h(a,b){for(var c in b)a[c]=b[c];return a}function i(a){return f(a.length)}function j(a,b){for(var c=!i(a)&&m(a),d=(c||a).length,e=Array(d),f=0;f<d;f++){var g=c?c[f]:f;e[f]=b(a[g],g,a)}return e}function k(a){return"function"==typeof a}function l(a,b){return a.indexOf(b)!=-1}function m(a){var b=[];for(var c in a)b.push(c);return b}function n(a){return"string"==typeof a||String.prototype.isPrototypeOf(a)}function g(a){return"undefined"==typeof a}function f(a){return!g(a)}function o(a){return U.prototype.isPrototypeOf(a)}function p(a){var b=W.get(a);return e(o(b)),b}function q(a,b){if(null==a)return a;var c,d=a.length;if(d===+d)for(c=0;c<d;c++){var e=b(c,a[c],a);if(e===!1)break}else{var f=m(a);for(c=0,d=f.length;c<d;c++){var e=b(f[c],a[f[c]],a);if(e===!1)break}}return a}function r(b){var c,d;return q(arguments,function(b,e){d=e.split(".");var f=d[0],h=c=a[f];!g(h)&&o(h)||(h=new U(f,h),c=a[f]=h),q(d.slice(1),function(a,b){var e=d.slice(0,a+2).join("."),f=c[b];!g(f)&&o(f)||(f=new U(e,f),c[b]=f),c=f})}),c}function s(){return W.namespaces()}function t(a){return a.stack?a.stack:"unkown\nunkown\nunkown\nunkown"}function u(a,b){var c;return 2==arguments.length?(c=a[b],e(f(c),"undefined ",b," in ",a)):(c=a,e(f(c),"undefined property")),c}function v(a){a.constructor&&a.constructor.__name__?da.call(console,a.constructor.__name__+"{}"):da.apply(console,c(arguments))}function w(a,b){var c,d;return ba&&a.bind===ba?ba.apply(a,ca.call(arguments,1)):(e(k(a)),c=ca.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(ca.call(arguments)));ctor.prototype=a.prototype;var e=new ctor;ctor.prototype=null;var f=a.apply(e,c.concat(ca.call(arguments)));return Object(f)===f?f:e})}function x(b){if(n(b)){for(var c,d=b.split("."),f=d.length,g=a,h=0;h<f;h++){var i=d[h];h==f-1?c=g[i]:g=g[i]}return e(c,b,"not found"),c}return b}function y(a,b){var c=!0;return q(a,function(a,d){var e=b[d];if(c=c&&f(e),!c)return!1}),c}function z(a){return JSON.stringify(a)}function A(a,b){return D(a,b)}function B(a,b){var c=a,d=b;k(c)&&(c=c.prototype),k(d)&&(d=d.prototype);var e=c==d;return e||(e=d.isPrototypeOf(c)),e}function C(a){return a===Object(a)}function D(a,b){var c=b;k(b)&&(c=b.prototype);var d=c.isPrototypeOf(a);if(!d){var e=a.constructor.__interfaces__;if(e)for(var f=e.length,g=0;g<f;g++){var h=e[g];if(d=h==c,1==d)break}}return d;var e,f,g,h}function E(a){var b=new qa(a);return b.subclass.apply(b,c(arguments).slice(1))}function F(){return pa.subclass.apply(pa,c(arguments))}function G(a){if(a.__super__){var b=a.__super__.constructor;return b==Object||C(b.__super__)}return!1}function H(a){if(k(a))return a;var b=a.constructor;return e(b),b}function I(a){var b=H(a),c=[],d=b.__super__;if(d){c.push(d.constructor);var e=I(d);c.push.apply(c,e)}return c}function J(a){var b=H(a),c=[],d=b.__subclasses__||[];return c.push.apply(c,d),d&&q(d,function(a,b){var d=J(b);c.push.apply(c,d)}),c}var K=d("log"),L=d("log"),M=a.justoop||{},N="__js_line__",O="__name__",P="__package__",Q="__current_package_name__",R=M[Q],S=R,T="justoop",U=function(){function a(a,b){this[O]=a,W.set(this),f(b)&&Z(this,b)}return a[P]=M[Q],a}(),V=function(){function a(){this.__namespaces={}}function b(a){e(o(a),a,"not a namespace object");var b=a[O],c=this.__namespaces;e(!c[b],b,"already defined"),this.__namespaces[b]=a}function c(){return j(this.__namespaces,function(a,b){return a})}function d(a){return this.__namespaces[a]}var f=a.prototype;return h(f,{package_property:R,get:d,set:b,namespaces:c}),a[P]=R,a}(),W=new V,X=M.debug||f(M.__loaded_packages__)&&f(S)&&!M.__loaded_packages__[S].compressed;X=!0;var Y=4,Z=M.publish=function(a,b){return a.__publish__?a.__publish__(b):q(b,function(b,c){if(["__publish__","__implements__"].indexOf(b)==-1){if(e(!a[b],b,"already defined"),e(f(c),"undefined value for",b),X&&c&&!c[N])try{throw new Error("")}catch(a){var d=t(a);try{c[N]=d.split("\n")[Y]}catch(a){}}if(c&&!c[P])try{c[P]=M[Q]}catch(a){}c&&c.__publish__&&(c=c.__publish__(a,b)),a[b]=c}}),a},$=r(T),_=Array.prototype,aa=Function.prototype,ba=aa.bind,ca=_.slice;if(a.console)try{var da=console.constructor.prototype.log;da!=v&&(console.log=v),K=w(console.log,console)}catch(a){K=function(){var a=c(arguments),b=a.join(" ");console.log(b)}}var ea=Array.prototype,fa=ea.slice,ga="__interfaces__",ha="__init__class__",ia="__subclasses__",ja="__super__",ka="constructor",la="__class__",ma=[ka,N,la,N,ga,ja,ia,"__overrides__","__implements__"],na=Object.prototype;"function"!=typeof Object.create&&(Object.create=function(){var a=function(){};return function(b){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;var c=new a;return a.prototype=null,c}}());var oa=function(){function a(){}function b(a,b,c){var d=a.__overrides__||{};d[b]=c,a.__overrides__=d}function c(a,b){var c=a.__overrides__||{},d=c[b]||0;return d}var d="missing new operator",h=a.prototype;return h.stack_depth=3,h.subclass=function(){var a,h,i,j,m,n=[],o=na.constructor;q(arguments,function(b,c){k(c)?n.push(c):(e(!a,"class prototype already specified"),a=c)}),h=n[0]||Object,i=n.slice(1);var p=this.stack_depth,r=Object.create(h.prototype);m=a.constructor,m==o&&(m=h.prototype.constructor),j=this._createConstructor(m,r,d),m=j,m.prototype=r;var s=[h].concat(i),u={};q(s,function(a,d){var e=d;k(d)&&(e=d.prototype),g(m[ga])&&(m[ga]=[]),m[ga].push(e),q(e,function(g){if(!l(ma,g)){var h,i;h=i=e[g],k(h)&&a&&(i=function(a,b){var a=g,c=b;return function(){return c[a].apply(this,arguments)}}(g,e));var j=c(d,g);if(f(u[g])){var m=c(u,g);j>m&&(u[g]=i,b(u,g,j))}else u[g]=i,b(u,g,j)}});for(var h in u)if(!l(ma,h)){var i=c(u,h),j=c(m,h);(i>j||g(r[h]))&&(b(m,h,i),a&&(r[h]=u[h]))}});for(var v in a)if(!l(ma,v)){var w=c(m,v);r[v]=a[v],b(m,v,w+1)}if(r.constructor=m,m[ja]=h.prototype,r[ha]&&r[ha].call(m),X)try{throw new Error("")}catch(a){var x=t(a);r[N]=x.split("\n")[p],m[N]=r[N]}return g(h[ia])&&(h[ia]=[]),h[ia].push(m),m[P]=M[Q],r[la]=m,m},h._createConstructor=function(a,b,c){return e(a),e(b),e(c),function(){e(b.isPrototypeOf(this),c),a.apply(this,arguments)}},a}(),pa=new oa,qa=function(a){function b(a){this.__className=a,qa.__super__.constructor.apply(this,c(arguments))}function d(a,b,c,d){e(this.__className,"missing classname");var f,g=this.__className;if(g.indexOf(".")==-1){qa[ja][a].apply(this,fa.call(arguments,1));f="var "+g+" = function (){f_.apply(this, arguments);};"+this.__className+";"}else{qa[ja][a].apply(this,fa.call(arguments,1));f=g+" = function (){f_.apply(this, arguments);};"+this.__className+";"}var h=eval(f);return h}function f(){var a=c(arguments);return d.apply(this,["_createConstructor"].concat(a))}function g(){return j(i,function(a){return a})}function h(){var a=this.__className;e(n(a),"first argument must ne a string");var b=qa[ja].subclass.apply(this,c(arguments));return b[O]=a,i[a]=b,b}var i={};return F({constructor:b,allClasses:g,_createConstructor:f,subclass:h,stack_depth:4},a)}(oa);Function.prototype.__publish__=function(a,b){if(this.prototype&&this.prototype.__class__){var c=[a.__name__,b].join(".");return this.__name__=c,this}return this};var ra=w,sa=function(a){function b(a){n(a)&&(a=this[a]),e(a,a,"not in ",this);var b=c(arguments).slice(1),d=ra.apply(this,[a,this].concat(b));return d}function d(){return J(this)}function f(){return I(this)}return F({bind:b,allSubclasses:d,allSuperclasses:f},Object)}(Object);Z($,{bind:w,allSubclasses:J,allSuperclasses:I,stringify:z,namespace:r,namespaces:s,isString:n,getErrorStack:t,isDefined:f,get:u,getObject:x,contains:l,each:q,map:j,ObjectEx:sa,log:K,error:L,isFunction:k,makeArray:c,debug_info:X,js_line_property:N,property_name:O,current_package_property:Q,package_property:P,hasMembers:y,existingNamespace:p,isUndefined:g,assert:e,getClass:x,subclass:F,Subclasser:oa,super_property:ja,isObject:C,isClass:G,isSubclass:B,implements_:A,public_class:E,PublicSubclasser:qa});$.publish=Z,"undefined"==typeof module&&r("justoop"),h(b,$),b.publish=Z}(b,a)}();
//# sourceMappingURL=justoop.0.1.5.min.js.map