Every global variable in javascript is a property of 'window'
Apparently all local variable (aswell as arguments) are stored as properties of the 'Call object' (See chapter 4.6.2 of each function. Persumably only existing for the lifetime of said function.
Basically I want to be able to do
for (var obj in CallObject ) { // }
Can I access said object containing local variables and if so how? Alternatively is there any other way of accessing all local variables of a function.
[Edit]
It turns out that arguments is a property of the Activation Object of a function. This has to be stored somewhere.
"The activation object is purely a
specification mechanism. It is
impossible for an ECMAScript program
to access the activation object."
Turns out ECMAScript states I am not allowed to access it.
What about accessing arguments properties and somehow chaining up to local variables?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…