原型、Reflect.constuct 组合题,麻烦前辈指导下

let target;
function A(a) {
  this.a = a;
  target = new.target;
}
const B = A.bind();
const C = B.bind();
const f = Reflect.construct(C, [], B);
console.log(target === A, Object.getPrototypeOf(f) === A.prototype);

其中 B.prototype 和 C.prototype 为什么为undefiend?

为什么 ?
输出 B 为 function A
输出 C 为 native code

Reflect.contruct(C, [], B)
难道不是以下转换吗?

f = new C()
f.__proto__ = B.prototype

Object.getPrototypeOf(f) === A.prototype
难道不是以下转换吗(结合上述推论)?

f.__proto__ === A.prototype
f.__proto__ === B.prototype
B.prototype ? === A.prototype
B.prototype = undefined
A.prototype = {
   constructor: A
   __proto__: xx
}

以上疑问无法得到解答,麻烦前辈们指导下,或者解析下这个题目。(非常感谢)

阅读 658
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题