zoukankan      html  css  js  c++  java
  • What is an Activation object in JavaScript ?

    ********************* from Professional JavaScript for Web Development

    Execution Context And Scope

      The execution context of a variable or function defines what other data it has access to, as well as how it should behave. Each execution context has an associated variable object upon which all of its defined variables and functions exist. 

      Each function call has its own execution context. Whenever code execution flows into a function, the function's context is pushed onto a context stack. After the function has finished executing, the stack is poped, returning control to the previously executing context.

      When code is executed in a context, a scope chain of variable objects is created. The purpose of the scope chain is to provide ordered access to all variables and functions that an execute context has access to. 

    ********************* from StackExchange

     Execution context is an object which consists of :

    • variable object, which is activation object is case of functions
    • scope chain, which you can think of as a linked list of outer scopes
    • this value

    Variable object is an abstract thing, which can be either one of those :

    • global object (in global context) ;
    • activation object (for functions) ;

    Activation object is an object which holds :

    • formal args of the function
    • arguments object for this function.
    • any vars and (named) function inside this functioin

    So, activation object is just a special case of variable object;

    It is basically a container for all the local stuff you can access by name inside a function, except for this

  • 相关阅读:
    python3 访问 rabbitmq 示例
    centos7 GNOME 安装微信客户端
    使用 rm -rf 删除了工程目录,然后从 pycharm 中找了回来
    主动做事,做一个靠谱的人
    Go net/http 发送常见的 http 请求
    学会感激,才能长大
    Go context 介绍和使用
    xargs 命令
    Docker 镜像 && 容器的基本操作
    CentOS && Ubuntu 环境下 Docker 的安装配置
  • 原文地址:https://www.cnblogs.com/linxd/p/4499813.html
Copyright © 2011-2022 走看看