Closed guojunsky closed 8 years ago
if (isFunction(receiver)) { for (var key in proto) { if (proto.hasOwnProperty(key)) { receiver.prototype[key] = proto[key] } } Object.keys(proto).forEach(function(key) { receiver.prototype[key] = proto[key] }) } 是不是考虑 try-catch 一下 try{ Object.keys(proto).forEach(function(key) { receiver.prototype[key] = proto[key] }) }catch(e){ for (var key in proto) { if (proto.hasOwnProperty(key)) { receiver.prototype[key] = proto[key] } } }
plz use es5-shim
if (isFunction(receiver)) { for (var key in proto) { if (proto.hasOwnProperty(key)) { receiver.prototype[key] = proto[key] } } Object.keys(proto).forEach(function(key) { receiver.prototype[key] = proto[key] }) } 是不是考虑 try-catch 一下 try{ Object.keys(proto).forEach(function(key) { receiver.prototype[key] = proto[key] }) }catch(e){ for (var key in proto) { if (proto.hasOwnProperty(key)) { receiver.prototype[key] = proto[key] } } }