Hey so i've been reading lately the ecmascript spec and i've encountered a talk about LexicalEnvironment and VariableEnvironment
like
- Let oldEnv be the running execution context's LexicalEnvironment.
- Let blockEnv be NewDeclarativeEnvironment(oldEnv).
- Perform BlockDeclarationInstantiation(StatementList, blockEnv).
- Set the running execution context's LexicalEnvironment to blockEnv.
- Let blockValue be the result of evaluating StatementList.
- Set the running execution context's LexicalEnvironment to oldEnv.
- Return blockValue.
right the LexicalEnvironment now points to the blockEnv which is a declarative Environment Record
but it doesn't says at what place we are searching for variables.
based on logic i assume it's searching inside the LexicalEnvironment.
what i'm asking is where can i find the rule that's says the place where we are looking for variables and functions.