Skip to content

Commit

Permalink
webpack1
Browse files Browse the repository at this point in the history
  • Loading branch information
tedjmzhang committed Jun 14, 2024
1 parent 5ecc7f0 commit 7199051
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/frontend/javascript/原型链说明.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
title: 原型链
---

## 说明:
每一个函数function都一个一个prototype属性,指向函数的原型。
通过new function生成的实例instance,包含一个constructor属性指向构造函数function,包含一个__proto__属性指向function.prototype。
所以有instance.__proto__ === function.prototype, instance.constructor === function。
通过class extends parentClass集成调用super的时候,相当于是new parentClass,并且将生成的Instance的__proto__指向新生成的new parentClass

### 10.原型链实现继承
不搞那些概念性的东西,直接说结论了,实现继承的方式就是:
***将第一个构造函数的原型等于第二个构造函数的实例,然后第一个构造函数的所有实例都会拥有第二个构造函数的所有自有属性以及原型属性***
Expand Down
1 change: 1 addition & 0 deletions src/frontend/library/webpack/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 带着问题看源码
1. 如何进行依赖收集,循环依赖如何处理
2. webpack将源码转换成ast是loader干的活,还是webpack内部干的
webpack内部原生支持转换javascript(使用acorn作为parser),
3. webpack如此多的hooks都放在了解析的哪一步
4. webpack的plugins有没有执行顺序,如果有的话,前后那个为准

Expand Down

0 comments on commit 7199051

Please sign in to comment.