Skip to content
大纲

js执行上下文

  1. 创建阶段
    • 生成变量对象VO
      1. 创建arguments
      2. 扫描函数声明
      3. 扫描变量声明
    • 建立作用域链-确定this的指向
executionContextObj = {
    this: 对的就是你关注的那个this,
    VO:变量对象,
    scopeChain: 作用域链,跟闭包相关
  }
  1. 执行阶段
    • 变量赋值
    • 函数的引用
    • 执行其他代码

Released under the MIT License.