Possible to get variable names created within a function?

Lets say I have this function.

function AAA()
{
var BBB;
function CCC(){}
}

and I want to trace out that function “AAA” declares a var named “BBB” and a function named “CCC” within itself. Is this at all possible?
Thanks!