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

 

转载于:https://www.cnblogs.com/linxd/p/4499813.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值