The variable q inside the function f is local, i.e. available inside the body function. Question: why is it not available in the obj.func function?
var qwe = 1;
function f () {
var q = {};
var qwe = 2;
debugger;
var obj = {
a: q,
func: function () {
// here q is not visible, but qwe === 1.
debugger;
}
};
obj.func ();
debugger;
}
f ();
It seems like when creating obj.func, its [[Scope]] should refer to the variable object of the function f (since func was created in the context of the function f), but from the code you can see that it refers to the global object (The qwe variable is 1 , not 2).

