摘要:
1. new User() 通过构造函数创建的对象的 __proto__ 指向构造函数的原型. 2. User() 构造函数中的 this 指向 User() 构造函数的实例对象. function myNew(target){ let result = {}; let arg = Array.pr 阅读全文
摘要:
instanceof 检查目标对象的原型链中是否有与指定对象的原型相同的原型, 通过 严格等于来对于两个原型是否相等。 function myInstanceof(target, source) { let proto = target.__proto__; let prototype = sour 阅读全文
摘要:
书接上文,从legacyRenderSubtreeIntoContainer - unbatchedUpdates看起 // Initial mount should not be batched. unbatchedUpdates(() => { // parentComponent = null 阅读全文