Reference|undefined GetIdentifierReference(lex:LexicalEnvironment|Null, name:String, strict:Boolean)
Get a new Reference which contains the Environment Record that contains the IdentifierName name you're looking for. Starts searching in the given Lexical Environment lex and will traverse the scope chain up to global scope.
function GetIdentifierReference(lex, name, strict){
if (lex === null) return new Reference(name, null, strict);
var envRec = lex.EnvironmentRecord;
var exists = envRec.HasBinding(N);
if (exists) return new Reference(name, envRec, strict);
var outer = lex.outerEnvironmentRecord;
// recursive call
return GetIdentifierReference(outer, name, strict);
}