8.5函数 作为命名空间的函数
var extend =(function(){
for (var p in {toString:null}){
return function extend(o){
for(var i=1; i <arguments.length;i++){
var source = arguments[i];
for(var prop in source) o[prop]=spirce[prop];
}
return o;}
};
}
return function patch_extend(o){
for(avr i =1; i < arguments.length;i++){
var source = arguments[i];
for (var prop in source ) o[prop]= source[prop];
for(var j=0;j<protoprops.length;J++){
prop = protoprops[j];
if (source.hasOwnProperty(prop)) o[prop] = source[prop];
}
}
return o;
};
var protoprops=["toString","valueOf","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString"];
})