Identifiers are resolved by binding the name to the value container through the scope chain.
A hierarchical access mechanism adds items to the front of the scope chain as code is nested. The most local variable object belonging to the current execution context is searched first. If the name is not resolved, then the scope chain is walked until a matching name is located or the global code's execution context is reached. If there is still no match, then the undefined value is returned.
An identifier is considered to be a primary expression when it is being evaluated.
ECMA 262 edition 2 - section - 10.1.4
ECMA 262 edition 2 - section - 11.1.2
ECMA 262 edition 3 - section - 10.1.4
ECMA 262 edition 3 - section - 11.1.2