   # walks up to the root scope.
   check: (name, options) ->
     immediate = Object::hasOwnProperty.call @variables, name
-    return immediate if immediate or (options and options.immediate)
-    !!(@parent and @parent.check(name))
+    return immediate if immediate or options?.immediate
+    !!@parent?.check name
 
   # Generate a temporary variable name at the given index.
   temporary: (type, index) ->

    index = 0
    index++ while @check(temp = @temporary type, index) and @variables[temp] isnt 'reuse'
    @variables[temp] = 'var'
    @garbage[@garbage.length - 1].push temp if @garbage.length
    temp

  # Ensure that an assignment is made at the top of this scope

  # Return to the previous garbage level and erase referenced temporary
  # variables in current level from scope.
  endLevel: ->
    vars = @variables
    (vars[name] = 'reuse') for name in @garbage.pop() when vars[name] is 'var'

  # Look up a variable name in lexical scope, and declare it if it does not
  # already exist.
