In IE you can't use obj.__proto__ = some_proto
, but you can go around this deficit by using inheritance through function, e.g.:
func = function(){}
func.prototype = proto
obj = new func
The problem with this roundabout is that old references to obj
are lost and won't point to the new obj
with proto
as prototype. Is there anyway to change the prototype of existing objects in IE?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…