第一次看见这样的语句,关注了...
for(var i in props)
            {}

解决方案 »

  1.   

    function $extNative()
    {
        for(var i=0;i<arguments.length;i++)
        {
            var fn = arguments[i];
            if(!typeof(fn))continue;//如果fn是undefined就continue
            if(!fn.extend)fn.extend = function(props)//如果这个fn没有extend属性 就定义fn.extend
            {
                for(var i in props)
                {
                    if(!this.prototype[i])this.prototype[i] = props[i];//如果this.prototype上没有i这个属性 就this.prototype[i] = props[i]
                    //下面的 看http://topic.csdn.net/u/20090313/22/37717fa8-74bf-4317-a13e-b4e284d4e6a2.html 6楼的回答
    if(!this[i])this[i] = (function(prop){return function(bind){return this.prototype[prop].apply(bind, Array.prototype.slice.call(arguments, 1));};})(i);
                 //如果this上没有i这个属性 就this[i]=function(bind){return this.prototype[prop].apply(bind, Array.prototype.slice.call(arguments, 1));}
    // ↑↑调用this.prototype[i]  prop是i ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑把第一个参数去掉  
    }
            }
        }
    };
    //所以$extNative()这个函数的意思就是:为参数添加extend属性(函数),extend(props)函数是:把props[i]分别赋到this.prototype和this上
    //(如果没有的话)  this[i](bind)会调用this.prototype[i].apply(bind,...)
      

  2.   

    发现个问题  在4楼那有个错误
    var ss
    function a(){
    for (var i = 0; i < arguments.length; i++) {
    var fn = arguments[i]
    alert(!typeof(fn) + ' ' + fn)
    }
    }
    a(false,ss,0,null,NaN,eval)//你会发现这些!typeof(fn)都为false
    //也就是说 至今还没找到!typeof(fn)为true的情况  难道if(!typeof(fn))continue;永远不被执行???