1. Encountering var a, Compiler asks Scope to see if a variable a already exists for that particular scope collection. If so, compiler ignores this declaration and moves on. Otherwise Compiler asks Scope to declare a new variable a for that scope.
2. Compiler then produces code for Engine to later execute, to handle the a = 2 assignment. The code Engine runs will first ask Scope if there is a variable called a accessible in the current scope collection. If so, Engine uses that variable. If not, Engine looks elsewhere (Nested Scope).