Is the function parameter of the active object (Active Object) in JS generated according to the formal parameter or the actual parameter?

When creating and initializing the variable object of a function in

JavaScript, that is, the active object (Active Object) AO, does it generate properties based on the formal parameters of the function or based on the arguments?

statement 1, generated according to formal parameters, in-depth understanding of the concept of JavaScript execution context, function stack, and promotion

Formal parameter of
function (when entering the context of function execution)-an attribute of a variable object whose property name is the name of the parameter and its value is the value of the argument; for parameters that are not passed, the value is undefined

statement 2, generated according to arguments, in-depth understanding of JavaScript series (12): variable object (Variable Object)

The
active object is created when it enters the function context and is initialized by the function"s arguments property. The value of the arguments property is the Arguments object:

this is very confusing.

there is a code:

var a=1.2,b={},c="hello";
function sumOf(x,y){
   var tmp=x+y;
   console.log(tmp);
}
sumOf(a,b,c);

I write the generated variable object according to each of the two statements, and if there is any error, please point it out.

when entering the executable code of the function sumOf, an active object is created and initialized:
statement 1: according to the formal parameter
AO_sumOf = {
x br 1.2,
y: {},
/ argument c is discarded, but can be accessed through sumOf.arguments [2].
tmp:undefined
}
statement 2: according to the argument
AO_sumOf = {
x:arguments [0],
y:arguments [1],
arguments [2]: arguments [2]; / / you can see that if the attribute is generated as an argument, the attribute name will be a problem
tmp:undefined
}

.

I prefer to use formal parameters to generate attribute values, but even in the original version of statement 1, I mentioned initializing parameters with arguments objects, which makes me confused.

Mar.14,2021

I personally prefer to say 1

AO = {
    arguments: { 0: 1.2, 1: reference to b, 2: 'hello', length: 3 },
    x: 1,
    y: reference to b,
    tmp: undefined
}

ECMAScript 3 specification-10.1.3 Variable Instantiation

for each formal parameter (Note: formal parameter), as defined in the FormalParameterList, create a property of the variable object whose name is the Identifier and whose attributes are determined by the type of code.

however, this is the specification of ES3, and ES5+ doesn't seem to use it.
ECMAScript 5 specification 10.6,10.4.3,13.2.1 should be these three pieces, but I don't quite understand the goose.

Menu