Skip to content
Browse files

Remove unused variable callback

  • Loading branch information...
1 parent 1e456d3 commit 21c52f37516c0038146985ca9051909463d6c5e3 @weikinhuang committed Mar 8, 2013
Showing with 5 additions and 5 deletions.
  1. +2 −2 dist/classify.js
  2. +2 −2 dist/classify.min.js
  3. +1 −1 src/namespace.js
View
4 dist/classify.js
@@ -5,7 +5,7 @@
* Copyright 2011-2012, Wei Kin Huang
* Classify is freely distributable under the MIT license.
*
- * Date: Fri, 08 Mar 2013 21:52:25 GMT
+ * Date: Fri, 08 Mar 2013 23:27:28 GMT
*/
(function(root, undefined) {
"use strict";
@@ -968,7 +968,7 @@ var Namespace = create({
// no class found
return null;
},
- load : function(name, callback) {
+ load : function(name) {
return this.ref[name] || null;
},
setAutoloader : function(callback) {
View
4 dist/classify.min.js
@@ -5,5 +5,5 @@
* Copyright 2011-2012, Wei Kin Huang
* Classify is freely distributable under the MIT license.
*
- * Date: Fri, 08 Mar 2013 21:52:25 GMT
- */;(function(e,t){"use strict";var n,r,i,s,o,u,a,f,l,c,h,p,d,v="prototype",m={},g=!{toString:null}.propertyIsEnumerable("toString"),y=g?"hasOwnProperty,valueOf,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,constructor".split(","):[],b=y.length,w=Object[v],E=w.toString,S=w.hasOwnProperty,x=/^(?:boolean|number|string|undefined)$/,T=function(e){return e===null||x.test(typeof e)},N=function(e){return E.call(e)==="[object Function]"},C=function(e){return e&&e[v]&&N(e)},k=Array.isArray||function(e){return E.call(e)==="[object Array]"},L=/^\s*function\s+.+?\(.*?\)\s*\{\s*\[native code\]\s*\}\s*$/,A=function(e){return N(e)&&L.test(e+"")},O=function(e){var t=[],n;for(n in e)t[t.length]=n;if(g)for(n=0;n<b;++n)S.call(e,y[n])&&(t[t.length]=y[n]);return t},M=function(e){return k(e)?e:[e]},_=function(e){return Array[v].slice.call(e,0)},D=Array[v].indexOf?function(e,t){return e.indexOf(t)}:function(e,t){var n=0,r=e.length;for(;n<r;++n)if(e[n]===t)return n;return-1},P=function(e,t){return e.__original_=t,e},H=function(e,n,r){if(!e)return e;var i,s=0,o=e.length,u;if(o===t||N(e)){u=O(e),o=u.length;for(i=e[u[0]];s<o;i=e[u[++s]])if(n.call(r||i,i,u[s],e)===!1)break}else for(i=e[0];s<o;i=e[++s])if(n.call(r||i,i,s,e)===!1)break;return e},B=function(e,t){var n=[];return H(e,function(r,i){n[n.length]=t(r,i,e)}),n},j=function(e,t){var n=[];return H(e,function(e){e!==t&&(n[n.length]=e)}),n},F=function(){var e=_(arguments),t=e.shift();return H(e,function(e){H(O(e),function(n){t[n]=e[n]})}),t},I=/^(?:superclass|subclass|implement|observable|bindings|extend|prototype|applicate|(?:add|remove)(?:Static|Observable|Aliased|Bound)Property)$/,q=/^__/,R={},U=[],z=[],W=[],X=[],V=[U,z,W,X],$=["onCreate","onPropAdd","onPropRemove","onInit"],J=A(Object.create)?Object.create:function(e){var t=function(){};return t[v]=e,new t},K=function(e,t,n){e[t]=n},Q=function(){var e=function(){};return e[v].init=function(){},e.superclass=null,e.subclass=[],e.implement=[],e[v].constructor=Q,e[v].self=Q,e.__isclass_=!0,e}(),G=function(e,n){return P(function(){var r=this.parent,i;return this.parent=e,i=n.apply(this,arguments),r===t?delete this.parent:this.parent=r,i},n)},Y=function(e,t){if(R[e])throw Error('Adding duplicate mutator "'+e+'".');R[e]=t,t.name=e,t.propTest=RegExp("^__"+e+"_"),t.propPrefix="__"+e+"_",H($,function(e,n){t[e]&&V[n].push(t)})},Z=function(e){var t=R[e];if(!t)throw Error("Removing unknown mutator.");H($,function(e,n){if(t[e]){var r=D(V[n],t);r>-1&&V[n].splice(r,1)}}),R[e]=null;try{delete R[e]}catch(n){}},et=function(e,t,n,r){var i,s,o;if(r===w[n])return;if(q.test(n)){i=!1,H(z,function(s){if(s.propTest.test(n))return n===s.propPrefix?H(r,function(n,r){s.onPropAdd.call(s,e,t,r,n)}):s.onPropAdd.call(s,e,t,n.replace(s.propTest,""),r),i=!0,!1});if(i)return}s=t[v][n],o=e[v],K(o,n,N(r)&&!r.__isclass_&&N(s)?G(s,r):r),N(r)&&H(e.subclass,function(e){N(e[v][n])&&!e[v][n].__original_&&K(e[v],n,G(o[n],e[v][n]))})},tt=function(e,t){var n=!1;if(q.test(t)){H(W,function(r){if(r.propTest.test(t))return r.onPropRemove.call(r,e,t.replace(r.propTest,"")),n=!0,!1});if(n)return}if(!N(e[v][t])){e[v][t]=null;try{delete e[v][t]}catch(r){}return}H(e.subclass,function(e){e[v][t]&&N(e[v][t])&&N(e[v][t].__original_)&&K(e[v],t,e[v][t].__original_)}),e[v][t]=null;try{delete e[v][t]}catch(r){}},nt=function(){var e=Q,n={},r=[],i=arguments,s=i.length,o,u;return s===1?n=i[0]:s===2?(!i[0].__isclass_&&!C(i[0])?r=M(i[0]):e=i[0],n=i[1]):(e=i[0],r=M(i[1]),n=i[2]),n=F({},n),!e.__isclass_&&!n.init&&(n.init=e),o=function(){var e,n,r;if(!this||!this.init||!(this instanceof o))return o.invoke.apply(o,arguments);for(n=0,r=X.length;n<r;n++){e=X[n].onInit.call(X[n],this,o);if(e!==t){if(T(e))throw Error("Return values during onInit hook can only be objects.");return e}}e=this.init.apply(this,arguments);if(e!==t){if(T(e))throw Error("Return values for the constructor can only be objects.");return e}},delete n.applicate,o.applicate=function(e){var t=function(){return o.apply(this,e)};return t[v]=o[v],new t},o.invoke=n.invoke||(e.invoke&&N(e.invoke)&&!e.invoke.__original_?e.invoke:null)||P(function(){return o.applicate(arguments)},!0),delete n.invoke,o.superclass=e,o.subclass=[],o.implement=(k(e.implement)?e.implement:[]).concat(r),u=o[v]=J(e[v]),o.extend=u.extend=function(){return nt.apply(null,[o].concat(_(arguments)))},e.subclass&&k(e.subclass)&&e.subclass.push(o),n.invoke=function(t,n){if(t in e[v]&&t!=="invoke"&&N(e[v][t])){var r=this.invoke,i;return this.invoke=e[v].invoke,i=e[v][t].apply(this,n||[]),this.invoke=r,i}throw Error('Function "'+t+'" of parent class being invoked is undefined.')},o.addProperty=function(n,r,i){return i=i||"",r===t&&typeof n!="string"?H(O(n),function(t){et(o,e,i+t,n[t])}):et(o,e,i+n,r),o},o.removeProperty=function(e){return tt(o,e),o},r.length!==0&&H(r,function(e){var t=e.__isclass_?e[v]:e;H(O(t),function(e){!S.call(u,e)&&!S.call(n,e)&&(n[e]=t[e])})}),H(U,function(t){t.onCreate.call(t,o,e)}),o.addProperty(n),u.constructor=o,u.self=o,o.__isclass_=!0,o};Y("static",{onCreate:function(e){var t=this.propPrefix;e.addStaticProperty=function(n,r){return e.addProperty(n,r,t)},e.removeStaticProperty=function(n){return e.removeProperty(t+n)}},onPropAdd:function(e,t,n,r){if(I.test(n))return;K(e,n,N(r)&&!r.__isclass_?P(function(){return r.apply(e,arguments)},r):r)},onPropRemove:function(e,t){if(I.test(t))return;e[t]=null;try{delete e[t]}catch(n){}}}),Y("nowrap",{onCreate:function(e){var t=this.propPrefix;e.addUnwrappedProperty=function(n,r){return e.addProperty(n,r,t)}},onPropAdd:function(e,t,n,r){K(e[v],n,r)}}),Y("alias",{onCreate:function(e){var t=this.propPrefix;e.addAliasedProperty=function(n,r){return e.addProperty(n,r,t)}},onPropAdd:function(e,t,n,r){et(e,t,n,function(){return this[r].apply(this,arguments)})}}),Y("bind",{onCreate:function(e,t){var n=this;e.bindings=(t.bindings||[]).slice(0),e.addBoundProperty=function(t,r){return e.addProperty(t,r,n.propPrefix)},e.removeBoundProperty=function(t){return e.removeProperty(n.propPrefix+t)}},onPropAdd:function(e,t,n,r){var i=D(e.bindings,n);i<0&&N(r)&&!r.__isclass_&&e.bindings.push(n),et(e,t,n,r)},onPropRemove:function(e,t){var n=D(e.bindings,t);if(n<0)return;e.bindings.splice(n,1),H(e.subclass,function(e){D(e.bindings,t)>-1&&!S.call(e[v],t)&&e.removeBoundProperty(t)}),tt(e,t)},onInit:function(e,t){var n=t.bindings||null;if(n===null||n.length===0)return;H(n,function(n){K(e,n,function(){var r=_(arguments);return r.unshift(this),t[v][n].apply(e,r)})})}}),n=nt({init:function(e,t,n){if(!e)throw Error("Cannot create Observer without class context.");this.context=e,this.name=t,this.events=[],this.writable=!0,this.delay=0,this._debounce=null,n!==null&&typeof n=="object"?(this.getter=N(n.get)?n.get:null,this.setter=N(n.set)?n.set:null,this.value=n.value,this.writable=typeof n.writable=="boolean"?n.writable:!0,this.delay=typeof n.delay=="number"?n.delay:0):this.value=n},get:function(){return this.getter?this.getter.call(this.context,this.value):this.value},set:function(e){var t=this.value,n=this.context;return this.writable?(this.value=this.setter?this.setter.call(n,e,t):e,this.value!==t&&this.emit(),n):n},emit:function(){var t=this,n=_(arguments);return this.delay>0?(this._debounce!==null&&e.clearTimeout(this._debounce),this._debounce=e.setTimeout(function(){t._debounce=null,t._triggerEmit(n)},this.delay)):this._triggerEmit(n),this.context},_triggerEmit:function(e){var t=0,n=this.events.length,r=this.context,i=this.events;e.unshift(this.value);for(;t<n;++t)i[t].apply(r,e)},addListener:function(e){if(!N(e))throw Error("Observer.addListener only takes instances of Function");return this.events[this.events.length]=e,this.context},once:function(e){if(!N(e))throw Error("Observer.once only takes instances of Function");var t=this,n=function(){t.removeListener(n),e.apply(this,arguments)};return n.listener=e,this.addListener(n),this.context},removeListener:function(e){if(!N(e))throw Error("Observer.removeListener only takes instances of Function");var t=this.context,n=this.events,r=-1,i=0,s=n.length;for(;i<s;++i)if(n[i]===e||n[i].listener&&n[i].listener===e){r=i;break}return r<0?t:(n.splice(i,1),t)},removeAllListeners:function(){return this.events=null,this.events=[],this.context},listeners:function(){return this.events},toValue:function(){return this.value&&this.value.toValue?this.value.toValue():this.value},toString:function(){return"[observer "+this.name+"]"}}),n[v].on=n[v].addListener,m.Observer=n,Y("observable",{onCreate:function(e,t){var n=this;e.observable=F({},t.observable||{}),e.addObservableProperty=function(t,r){return e.addProperty(t,r,n.propPrefix)},e.removeObservableProperty=function(t){return e.removeProperty(n.propPrefix+t)}},onPropAdd:function(e,t,n,r){e.observable[n]=r,K(e[v],n,null),H(e.subclass,function(e){S.call(e.observable,n)||e.addObservableProperty(n,r)})},onPropRemove:function(e,t){var n=e.observable[t];H(e.subclass,function(e){e.observable[t]===n&&e.removeObservableProperty(t)}),e.observable[t]=null;try{delete e.observable[t]}catch(r){}},onInit:function(e,t){var r,i=t.observable||null;if(i===null)return;for(r in i)S.call(i,r)&&(e[r]=new n(e,r,i[r]))}}),r={},i="GLOBAL",f=function(e,t){return H(e,function(e){t[e]||(t[e]={}),t=t[e]}),t},l=function(e,t,n){if(typeof t=="string"){n=e.get(t);if(!n)throw Error("Invalid parent class ["+t+"] specified.");return n}return k(t)?B(t,function(t){return l(e,t)}):t},c=nt({init:function(e){this.ref={},this.name=e},create:function(){var e=_(arguments),t=e.shift(),n=t.split("."),r=n.pop(),i=this,s=f(n,i),o=nt.apply(null,B(e,function(e){return l(i,e)}));return o._name_=r,o._namespace_=t,o.extend=o[v].extend=function(){return nt.apply(null,[o].concat(B(arguments,function(e){return l(i,e)})))},o.getNamespace=function(){return i},o.toString=function(){return"[object "+t+"]"},s[r]=o,i.ref[t]=o,o},destroy:function(e){var t,n=e.split("."),r=n.pop(),i=this,s=this,o=this.ref;return H(n,function(e){if(!s[e])return s=null,!1;s=s[e]}),s?(t=s[r],t?(H(t.subclass,function(e){i.destroy(e._namespace_)}),t.superclass.subclass&&(t.superclass.subclass=j(t.superclass.subclass,t)),H(o,function(t,n){n!==e&&n.indexOf(e)===0&&i.destroy(t._namespace_)}),delete s[r],delete o[e],this):this):this},exists:function(e){return!!this.ref[e]},get:function(e){var t;return this.ref[e]?this.ref[e]:(t=this.load(e),t!==null?t:this.name!==i?a().get(e):null)},load:function(e,t){return this.ref[e]||null},setAutoloader:function(e){if(!N(e))throw Error("Namespace.setAutoloader only takes instances of Function");return this.load=e,this},getName:function(){return this.name},toString:function(){return"[namespace "+this.name+"]"}}),s=function(e){return e instanceof c?e:(e=e||i,r[e]||(r[e]=new c(e)),r[e])},o=function(e){e instanceof c&&(e=e.name);if(e===i)return;delete r[e]},u=function(e){var t,n=e.split("."),i=n.length;while((t=n.slice(0,i--).join("."))!=="")if(r[t])return r[t];return null},a=function(){return s(i)},F(m,{Namespace:c,getNamespace:s,destroyNamespace:o,testNamespace:u,getGlobalNamespace:a,global:a(),provide:function(t,n){return f(t.split("."),n||e||{})}}),h="/",p=nt({invoke:function(){var e=_(arguments),t=e.length,n,r;if(t===0)return s();if(typeof e[0]=="string")return t===1?(r=e[0].split(h),n=s(r[0]),r[1]?n.get(r[1]):n):t===2&&typeof e[1]=="string"?s(e[0]).get(e[1]):(r=e.shift().split(h),n=s(r[0]),r[1]&&e.unshift(r[1]),n.create.apply(n,e));return nt.apply(null,e)},init:function(){var e=_(arguments),t,n;if(e.length<1)throw Error("Classify object cannot be instantiated!");return t=k(e[e.length-1])?e.pop():[],n=p.invoke.apply(null,e),n.__isclass_?n.applicate(t):n}}),F(p,m,{version:"0.10.2",create:nt,addMutator:Y,removeMutator:Z,extend:F}),typeof define=="function"&&define.amd&&define(function(){return p}),typeof module!="undefined"&&module.exports?(module.exports=p,p.Classify=p):(d=e.Classify,e.Classify=p,p.noConflict=function(){return d===t?delete e.Classify:e.Classify=d,p})})(this);
+ * Date: Fri, 08 Mar 2013 23:27:28 GMT
+ */;(function(e,t){"use strict";var n,r,i,s,o,u,a,f,l,c,h,p,d,v="prototype",m={},g=!{toString:null}.propertyIsEnumerable("toString"),y=g?"hasOwnProperty,valueOf,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,constructor".split(","):[],b=y.length,w=Object[v],E=w.toString,S=w.hasOwnProperty,x=/^(?:boolean|number|string|undefined)$/,T=function(e){return e===null||x.test(typeof e)},N=function(e){return E.call(e)==="[object Function]"},C=function(e){return e&&e[v]&&N(e)},k=Array.isArray||function(e){return E.call(e)==="[object Array]"},L=/^\s*function\s+.+?\(.*?\)\s*\{\s*\[native code\]\s*\}\s*$/,A=function(e){return N(e)&&L.test(e+"")},O=function(e){var t=[],n;for(n in e)t[t.length]=n;if(g)for(n=0;n<b;++n)S.call(e,y[n])&&(t[t.length]=y[n]);return t},M=function(e){return k(e)?e:[e]},_=function(e){return Array[v].slice.call(e,0)},D=Array[v].indexOf?function(e,t){return e.indexOf(t)}:function(e,t){var n=0,r=e.length;for(;n<r;++n)if(e[n]===t)return n;return-1},P=function(e,t){return e.__original_=t,e},H=function(e,n,r){if(!e)return e;var i,s=0,o=e.length,u;if(o===t||N(e)){u=O(e),o=u.length;for(i=e[u[0]];s<o;i=e[u[++s]])if(n.call(r||i,i,u[s],e)===!1)break}else for(i=e[0];s<o;i=e[++s])if(n.call(r||i,i,s,e)===!1)break;return e},B=function(e,t){var n=[];return H(e,function(r,i){n[n.length]=t(r,i,e)}),n},j=function(e,t){var n=[];return H(e,function(e){e!==t&&(n[n.length]=e)}),n},F=function(){var e=_(arguments),t=e.shift();return H(e,function(e){H(O(e),function(n){t[n]=e[n]})}),t},I=/^(?:superclass|subclass|implement|observable|bindings|extend|prototype|applicate|(?:add|remove)(?:Static|Observable|Aliased|Bound)Property)$/,q=/^__/,R={},U=[],z=[],W=[],X=[],V=[U,z,W,X],$=["onCreate","onPropAdd","onPropRemove","onInit"],J=A(Object.create)?Object.create:function(e){var t=function(){};return t[v]=e,new t},K=function(e,t,n){e[t]=n},Q=function(){var e=function(){};return e[v].init=function(){},e.superclass=null,e.subclass=[],e.implement=[],e[v].constructor=Q,e[v].self=Q,e.__isclass_=!0,e}(),G=function(e,n){return P(function(){var r=this.parent,i;return this.parent=e,i=n.apply(this,arguments),r===t?delete this.parent:this.parent=r,i},n)},Y=function(e,t){if(R[e])throw Error('Adding duplicate mutator "'+e+'".');R[e]=t,t.name=e,t.propTest=RegExp("^__"+e+"_"),t.propPrefix="__"+e+"_",H($,function(e,n){t[e]&&V[n].push(t)})},Z=function(e){var t=R[e];if(!t)throw Error("Removing unknown mutator.");H($,function(e,n){if(t[e]){var r=D(V[n],t);r>-1&&V[n].splice(r,1)}}),R[e]=null;try{delete R[e]}catch(n){}},et=function(e,t,n,r){var i,s,o;if(r===w[n])return;if(q.test(n)){i=!1,H(z,function(s){if(s.propTest.test(n))return n===s.propPrefix?H(r,function(n,r){s.onPropAdd.call(s,e,t,r,n)}):s.onPropAdd.call(s,e,t,n.replace(s.propTest,""),r),i=!0,!1});if(i)return}s=t[v][n],o=e[v],K(o,n,N(r)&&!r.__isclass_&&N(s)?G(s,r):r),N(r)&&H(e.subclass,function(e){N(e[v][n])&&!e[v][n].__original_&&K(e[v],n,G(o[n],e[v][n]))})},tt=function(e,t){var n=!1;if(q.test(t)){H(W,function(r){if(r.propTest.test(t))return r.onPropRemove.call(r,e,t.replace(r.propTest,"")),n=!0,!1});if(n)return}if(!N(e[v][t])){e[v][t]=null;try{delete e[v][t]}catch(r){}return}H(e.subclass,function(e){e[v][t]&&N(e[v][t])&&N(e[v][t].__original_)&&K(e[v],t,e[v][t].__original_)}),e[v][t]=null;try{delete e[v][t]}catch(r){}},nt=function(){var e=Q,n={},r=[],i=arguments,s=i.length,o,u;return s===1?n=i[0]:s===2?(!i[0].__isclass_&&!C(i[0])?r=M(i[0]):e=i[0],n=i[1]):(e=i[0],r=M(i[1]),n=i[2]),n=F({},n),!e.__isclass_&&!n.init&&(n.init=e),o=function(){var e,n,r;if(!this||!this.init||!(this instanceof o))return o.invoke.apply(o,arguments);for(n=0,r=X.length;n<r;n++){e=X[n].onInit.call(X[n],this,o);if(e!==t){if(T(e))throw Error("Return values during onInit hook can only be objects.");return e}}e=this.init.apply(this,arguments);if(e!==t){if(T(e))throw Error("Return values for the constructor can only be objects.");return e}},delete n.applicate,o.applicate=function(e){var t=function(){return o.apply(this,e)};return t[v]=o[v],new t},o.invoke=n.invoke||(e.invoke&&N(e.invoke)&&!e.invoke.__original_?e.invoke:null)||P(function(){return o.applicate(arguments)},!0),delete n.invoke,o.superclass=e,o.subclass=[],o.implement=(k(e.implement)?e.implement:[]).concat(r),u=o[v]=J(e[v]),o.extend=u.extend=function(){return nt.apply(null,[o].concat(_(arguments)))},e.subclass&&k(e.subclass)&&e.subclass.push(o),n.invoke=function(t,n){if(t in e[v]&&t!=="invoke"&&N(e[v][t])){var r=this.invoke,i;return this.invoke=e[v].invoke,i=e[v][t].apply(this,n||[]),this.invoke=r,i}throw Error('Function "'+t+'" of parent class being invoked is undefined.')},o.addProperty=function(n,r,i){return i=i||"",r===t&&typeof n!="string"?H(O(n),function(t){et(o,e,i+t,n[t])}):et(o,e,i+n,r),o},o.removeProperty=function(e){return tt(o,e),o},r.length!==0&&H(r,function(e){var t=e.__isclass_?e[v]:e;H(O(t),function(e){!S.call(u,e)&&!S.call(n,e)&&(n[e]=t[e])})}),H(U,function(t){t.onCreate.call(t,o,e)}),o.addProperty(n),u.constructor=o,u.self=o,o.__isclass_=!0,o};Y("static",{onCreate:function(e){var t=this.propPrefix;e.addStaticProperty=function(n,r){return e.addProperty(n,r,t)},e.removeStaticProperty=function(n){return e.removeProperty(t+n)}},onPropAdd:function(e,t,n,r){if(I.test(n))return;K(e,n,N(r)&&!r.__isclass_?P(function(){return r.apply(e,arguments)},r):r)},onPropRemove:function(e,t){if(I.test(t))return;e[t]=null;try{delete e[t]}catch(n){}}}),Y("nowrap",{onCreate:function(e){var t=this.propPrefix;e.addUnwrappedProperty=function(n,r){return e.addProperty(n,r,t)}},onPropAdd:function(e,t,n,r){K(e[v],n,r)}}),Y("alias",{onCreate:function(e){var t=this.propPrefix;e.addAliasedProperty=function(n,r){return e.addProperty(n,r,t)}},onPropAdd:function(e,t,n,r){et(e,t,n,function(){return this[r].apply(this,arguments)})}}),Y("bind",{onCreate:function(e,t){var n=this;e.bindings=(t.bindings||[]).slice(0),e.addBoundProperty=function(t,r){return e.addProperty(t,r,n.propPrefix)},e.removeBoundProperty=function(t){return e.removeProperty(n.propPrefix+t)}},onPropAdd:function(e,t,n,r){var i=D(e.bindings,n);i<0&&N(r)&&!r.__isclass_&&e.bindings.push(n),et(e,t,n,r)},onPropRemove:function(e,t){var n=D(e.bindings,t);if(n<0)return;e.bindings.splice(n,1),H(e.subclass,function(e){D(e.bindings,t)>-1&&!S.call(e[v],t)&&e.removeBoundProperty(t)}),tt(e,t)},onInit:function(e,t){var n=t.bindings||null;if(n===null||n.length===0)return;H(n,function(n){K(e,n,function(){var r=_(arguments);return r.unshift(this),t[v][n].apply(e,r)})})}}),n=nt({init:function(e,t,n){if(!e)throw Error("Cannot create Observer without class context.");this.context=e,this.name=t,this.events=[],this.writable=!0,this.delay=0,this._debounce=null,n!==null&&typeof n=="object"?(this.getter=N(n.get)?n.get:null,this.setter=N(n.set)?n.set:null,this.value=n.value,this.writable=typeof n.writable=="boolean"?n.writable:!0,this.delay=typeof n.delay=="number"?n.delay:0):this.value=n},get:function(){return this.getter?this.getter.call(this.context,this.value):this.value},set:function(e){var t=this.value,n=this.context;return this.writable?(this.value=this.setter?this.setter.call(n,e,t):e,this.value!==t&&this.emit(),n):n},emit:function(){var t=this,n=_(arguments);return this.delay>0?(this._debounce!==null&&e.clearTimeout(this._debounce),this._debounce=e.setTimeout(function(){t._debounce=null,t._triggerEmit(n)},this.delay)):this._triggerEmit(n),this.context},_triggerEmit:function(e){var t=0,n=this.events.length,r=this.context,i=this.events;e.unshift(this.value);for(;t<n;++t)i[t].apply(r,e)},addListener:function(e){if(!N(e))throw Error("Observer.addListener only takes instances of Function");return this.events[this.events.length]=e,this.context},once:function(e){if(!N(e))throw Error("Observer.once only takes instances of Function");var t=this,n=function(){t.removeListener(n),e.apply(this,arguments)};return n.listener=e,this.addListener(n),this.context},removeListener:function(e){if(!N(e))throw Error("Observer.removeListener only takes instances of Function");var t=this.context,n=this.events,r=-1,i=0,s=n.length;for(;i<s;++i)if(n[i]===e||n[i].listener&&n[i].listener===e){r=i;break}return r<0?t:(n.splice(i,1),t)},removeAllListeners:function(){return this.events=null,this.events=[],this.context},listeners:function(){return this.events},toValue:function(){return this.value&&this.value.toValue?this.value.toValue():this.value},toString:function(){return"[observer "+this.name+"]"}}),n[v].on=n[v].addListener,m.Observer=n,Y("observable",{onCreate:function(e,t){var n=this;e.observable=F({},t.observable||{}),e.addObservableProperty=function(t,r){return e.addProperty(t,r,n.propPrefix)},e.removeObservableProperty=function(t){return e.removeProperty(n.propPrefix+t)}},onPropAdd:function(e,t,n,r){e.observable[n]=r,K(e[v],n,null),H(e.subclass,function(e){S.call(e.observable,n)||e.addObservableProperty(n,r)})},onPropRemove:function(e,t){var n=e.observable[t];H(e.subclass,function(e){e.observable[t]===n&&e.removeObservableProperty(t)}),e.observable[t]=null;try{delete e.observable[t]}catch(r){}},onInit:function(e,t){var r,i=t.observable||null;if(i===null)return;for(r in i)S.call(i,r)&&(e[r]=new n(e,r,i[r]))}}),r={},i="GLOBAL",f=function(e,t){return H(e,function(e){t[e]||(t[e]={}),t=t[e]}),t},l=function(e,t,n){if(typeof t=="string"){n=e.get(t);if(!n)throw Error("Invalid parent class ["+t+"] specified.");return n}return k(t)?B(t,function(t){return l(e,t)}):t},c=nt({init:function(e){this.ref={},this.name=e},create:function(){var e=_(arguments),t=e.shift(),n=t.split("."),r=n.pop(),i=this,s=f(n,i),o=nt.apply(null,B(e,function(e){return l(i,e)}));return o._name_=r,o._namespace_=t,o.extend=o[v].extend=function(){return nt.apply(null,[o].concat(B(arguments,function(e){return l(i,e)})))},o.getNamespace=function(){return i},o.toString=function(){return"[object "+t+"]"},s[r]=o,i.ref[t]=o,o},destroy:function(e){var t,n=e.split("."),r=n.pop(),i=this,s=this,o=this.ref;return H(n,function(e){if(!s[e])return s=null,!1;s=s[e]}),s?(t=s[r],t?(H(t.subclass,function(e){i.destroy(e._namespace_)}),t.superclass.subclass&&(t.superclass.subclass=j(t.superclass.subclass,t)),H(o,function(t,n){n!==e&&n.indexOf(e)===0&&i.destroy(t._namespace_)}),delete s[r],delete o[e],this):this):this},exists:function(e){return!!this.ref[e]},get:function(e){var t;return this.ref[e]?this.ref[e]:(t=this.load(e),t!==null?t:this.name!==i?a().get(e):null)},load:function(e){return this.ref[e]||null},setAutoloader:function(e){if(!N(e))throw Error("Namespace.setAutoloader only takes instances of Function");return this.load=e,this},getName:function(){return this.name},toString:function(){return"[namespace "+this.name+"]"}}),s=function(e){return e instanceof c?e:(e=e||i,r[e]||(r[e]=new c(e)),r[e])},o=function(e){e instanceof c&&(e=e.name);if(e===i)return;delete r[e]},u=function(e){var t,n=e.split("."),i=n.length;while((t=n.slice(0,i--).join("."))!=="")if(r[t])return r[t];return null},a=function(){return s(i)},F(m,{Namespace:c,getNamespace:s,destroyNamespace:o,testNamespace:u,getGlobalNamespace:a,global:a(),provide:function(t,n){return f(t.split("."),n||e||{})}}),h="/",p=nt({invoke:function(){var e=_(arguments),t=e.length,n,r;if(t===0)return s();if(typeof e[0]=="string")return t===1?(r=e[0].split(h),n=s(r[0]),r[1]?n.get(r[1]):n):t===2&&typeof e[1]=="string"?s(e[0]).get(e[1]):(r=e.shift().split(h),n=s(r[0]),r[1]&&e.unshift(r[1]),n.create.apply(n,e));return nt.apply(null,e)},init:function(){var e=_(arguments),t,n;if(e.length<1)throw Error("Classify object cannot be instantiated!");return t=k(e[e.length-1])?e.pop():[],n=p.invoke.apply(null,e),n.__isclass_?n.applicate(t):n}}),F(p,m,{version:"0.10.2",create:nt,addMutator:Y,removeMutator:Z,extend:F}),typeof define=="function"&&define.amd&&define(function(){return p}),typeof module!="undefined"&&module.exports?(module.exports=p,p.Classify=p):(d=e.Classify,e.Classify=p,p.noConflict=function(){return d===t?delete e.Classify:e.Classify=d,p})})(this);
View
2 src/namespace.js
@@ -152,7 +152,7 @@ var Namespace = create({
// no class found
return null;
},
- load : function(name, callback) {
+ load : function(name) {
return this.ref[name] || null;
},
setAutoloader : function(callback) {

0 comments on commit 21c52f3

Please sign in to comment.
Something went wrong with that request. Please try again.