司徒正美今天的新文章一出来,第一句话我就看不懂,先出来三个分号,啥意思啊?谁帮忙解释下,如果能全部解释下那就最好了,发现差距越来越大,他的文章我怎么都看不懂的/*dom Framework version 1.0
Copyright 2010
Dual licensed under the MIT or GPL Version 2 licenses.
author: <ruby> <rb>司徒正美<rp>(zhongqincheng)</rp></rb><rt>しとぅなさみ</rt></ruby>
http://www.cnblogs.com/rubylouvre/
*/
   //=========================================
    // OOP模块 提供强大的面向对象编程, ruby风格的继承机制
    //==========================================
    ;;;(function(dom,window,undefined){
        dom.provide("oop");
 
        var classMethods = (function() {
            var include = ["constructor"],
            extend  = 'prototype $supers $super extend include'.toArray();
            function cleanModule(module, array) {
                array = array == 'extend' ? extend : include
                for(var key in module){
                    if(module.hasOwnProperty(key) && array.contains(key)){
                        delete module[key]
                    }
                }
                return module;
            }
            return {
                //桥梁模式,将实现化与抽象化脱耦,便得两者可以独立地变化
                //http://javascript.crockford.com/prototypal.html
                inherit: function(parent) {
                    if (parent && parent.prototype) {
                        var bridge = function() {};
                        bridge.prototype = parent.prototype;
                        this.prototype = new bridge;
                        this.$super = parent;
                    }
                    this.$supers = [];//这里的this为类
                    while (parent) {
                        if(!dom.isPureObject(parent)){//父类不能为默认添加的Object
                            this.$supers.push(parent);
                            parent = parent.$super;
                        }
                    }
                    return this.prototype.constructor = this;
                },
                alias : function(oldName, newName){
                    var proto = this.prototype;
                    if (dom.isString(oldName)){
                        var method = proto[oldName]
                        method && (proto[newName] = method);
                    }else if(is(oldName,"Object")){
                        dom.each(oldName,function(neo,old){
                            this.alias(old,neo)
                        },this)
                    }
                    return this;
                },
                //为新类添加一些类成员
                extend: function() {
                    dom.toArray(arguments).each(function(module){
                        dom.mixin(this, cleanModule(module, 'extend'));
                    },this);
                    return this;
                },
                //为新类添加原型成员,如果它们是函数,则判断其与父类有没有同名方法,
                //有则改写当前类的成员,在它上面添加一个$super属性
                include: function() {
                    var $supers = this.$supers.pluck('prototype');
                    dom.slice(arguments).each(function(module){
                        cleanModule(module, 'include');//去除模块包中那些危险属性
                        dom.keys(module).each(function(key){
                            var value = module[key],isFn = dom.is(value,"Function");
                            if(key.startsWith("protected ")){
                                key = key.toArray()[1];
                                if(isFn){
                                    value._protected = true;
                                }
                            }
                            var parent = $supers.first(function(proto) {
                                return dom.is(proto[key],"Function");
                            });
                            this.prototype[key] = isFn ?
                            (function( method,  key, parent) {
                                return function() {
                                    parent && (this.$super = parent[key]);     
                                    if (method._protected && this._method == null){
                                        throw new Error('The method "' + key + '" is protected!');
                                    }
                                    this._method = arguments.callee;
                                    var result = method.apply(this, arguments);
                                    delete this._method;
                                    return result;
                                };
                            })(value,  key, parent) :value;
                            if(isFn){
                                this.prototype[key].toString = function(){
                                    return String(value);
                                }
                            }
                        },this);
                    },this);
                    return this;
                }
            }
        })();
        //第一类工厂
        //{inherit :superclass,include:instance_member,extend:class_member,singleton:boolean}
        dom.oop = function(obj){
            obj = obj || {};
            //新类的原始构造器
            var init = init || obj.init || dom.noop;
            delete obj.init;
            //父类
            var superclass = obj.inherit || Object;
            //判定是否需要实现单例
            var singleton  = !!obj.singleton ;
            delete obj.singleton;
            //------------------创建新类--------------------------------------------
            var klass = function() {
                if(singleton && klass.instance){//实现单例模式
                    return klass.instance
                }
                superclass.apply(this, arguments);
                init.apply(this, arguments);
                if(singleton)
                    klass.instance = this;
                return this;
            };
            //添加泛化成员与原型成员
            dom.mixin(klass, classMethods).inherit(superclass);
            ["extend", "include"].each(function(name) {
                if (obj[name]) {
                    var modules = dom.toArray(obj[name]);
                    klass[name].apply(klass, modules);
                    delete obj[name];
                }
            });
            var proto = klass.prototype;
            klass.include(obj);
            if(!proto.__proto__){//修复IE与Opera中的第二条原型链
                proto.__proto__ = proto
            }
            proto.$super = superclass;
            klass.toString = function(){//重写构造子的toString
                return init.toString();
            }
            return klass
        }
    })(window[escape(document.URL.split("#")[0])],this);