js的这些个MVC框架喜欢的不得了,可是看一遍又忘记了,无法领悟其要领,遂摘抄下来,希望能够加深理解。
(function(){
var $,Controller,Events,Log,Model,Module,Spine,guid,isArray,MakeArray,moduleKeywords;
//数组分割
var __Slice = Array.prototype.slice,
//数组的序列号,如果没实现就自己实现
__indexOf = Array.prototype.indexOf||function(item){
for(var i =0,l=this.length;i<l;i++){
if(this[i]===item) return i;
}
return -1;
},
//实现bind
__bind = function(fn,me){return function(){
return fn.apply(me,arguments);
};
},
__hasProp = Object.prototype.hasOwnProperty,
__extends = function(child,parent){
for(var key in parent){
if(__hasProp.call(parent,key)) child[key] = parent[key];
}
function ctor(){
this.constructor = child;
}
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ =parent.prototype;
return child;
};
})