B as a function has an own property named "prototype". B.prototype.constructor is B. This is the default behavior.
ln#11 and ln#12 attempts to change the default and should always come together in that: ln#11 changes B's prototype; and if you changes B's prototype to C, you should set C's own property "constructor" to B. In this way you can avoid a pervert case that a consturctor(X)'s constructed object's constructor(not own but inherited) is not X.
【 在 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.*
b.constructor === B; //not true; so this is pervert in that b is CONSTRUCTED by B and b.constructor shall be B
【 在 xiatianup (李 ,只是期待夏天!!) 的大作中提到: 】 : 谢谢,已经认真看了(英文不好,反复看。。。) : and if you changes B's prototype to C, you should set C's own property "constructor" to B. : 意思就是继承自哪个,就把B的constructor指向被继承的对象吧。 : ................... -- FROM 183.95.135.*