Consider this code:
```
function f(g) {
g();
}
f(function () {
return;
});
h = 123;
```
Put a breakpoint at return. When it's hit, the current function is reported as "h" in the call stack, even though it's an anonymous function that has no relation to variable h.
In general, it seems to be the case that an anon function gets assigned the name of the first variable that is assigned anywhere after the function-expression is evaluated.
```
function f(g) {
g();
}
f(function () {
return;
});
h = 123;
```
Put a breakpoint at return. When it's hit, the current function is reported as "h" in the call stack, even though it's an anonymous function that has no relation to variable h.
In general, it seems to be the case that an anon function gets assigned the name of the first variable that is assigned anywhere after the function-expression is evaluated.