aralejs / events

Events Utility
aralejs.org/events/
34 stars 41 forks source link

代码应该有兼容问题 IE8- 直接报错吧 #22

Closed guojunsky closed 8 years ago

guojunsky commented 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] } } }

lepture commented 8 years ago

plz use es5-shim