谢谢,已经认真看了(英文不好,反复看。。。)
and if you changes B's prototype to C, you should set C's own property "constructor" to B.
意思就是继承自哪个,就把B的constructor指向被继承的对象吧。
如果这样无误的话,第12行可以完全去掉,并不需要11和12行一起用,因为没有12行时,它就是这样继承的,只有把B的constructor指向回它自己的时候,12行才是需要的。
【 在 a0123456789q (a0123456789q) 的大作中提到: 】
: as to your code,
: B as a function has an own property named "prototype". B.prototype.constructor is B. This is the default behavior.
:
: ...................
--
FROM 115.190.211.*