Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript, Does ES5+ still has an activation object?

Was reading some information regarding execution context of javascript. I was reading the following article of Rupesh Mishra.

The article stated that a new execution context is created with every new function invocation. An execution context does have 2 phases creation phase and execution phase where the code is executed line by line.

There was stated that an in the creation phase the JS engine does 3 things:

  1. Determines the value of this
  2. Creates the scope chain
  3. Creates the Activation or variable object

This was the explanation of the activation object:

Creates the Activation object or the variable object: Activation object is a special object in JS which contain all the variables, function arguments and inner functions declarations information. As activation object is a special object it does not have the dunder proto property.

Question:

Does ES5+ still has this activation object structure? If not, what are the current steps of the creation phase of an execution context?

like image 867
Willem van der Veen Avatar asked Nov 19 '25 15:11

Willem van der Veen


1 Answers

Nope, ES5 (and higher) does no longer use a standard JS object to store variables. It uses lexical environments (with this value and scope chain) that contain environment records of various kinds in which the values for the variables are stored.

What are the current steps of the creation phase of an execution context?

Section 10.4 Establishing an Execution Context talks about that.

The behaviour is not too different from what ES3 did (after all old code still works), it's just described using new terms.

like image 157
Bergi Avatar answered Nov 22 '25 06:11

Bergi