   # because other nodes like to check the existence of their variables as well.
   # Be careful not to double-evaluate anything.
   @compile_test: (o, variable) ->
-    [first, second]: [variable, variable]
-    if variable instanceof CallNode or (variable instanceof ValueNode and variable.has_properties())
-      [first, second]: variable.compile_reference(o)
-    [first, second]: [first.compile(o), second.compile(o)]
-    "(typeof $first !== \"undefined\" && $second !== null)"
+    [first, second]: variable.compile_reference o, true
+    "(typeof ${first.compile(o)} !== \"undefined\" && ${second.compile(o)} !== null)"
 
 #### ParentheticalNode
 

    @exclusive: !!exclusive

  # Compiles the range's source variables -- where it starts and where it ends.
  compile_variables: (o) ->
    @tab: o.indent
    [@from_var, @to_var]: [o.scope.free_variable(), o.scope.free_variable()]
    [from, to]:           [@from.compile(o), @to.compile(o)]
    "$@from_var = $from; $@to_var = $to;\n$@tab"

  # When compiled normally, the range returns the contents of the *for loop*
  # needed to iterate over the values in the range. Used by comprehensions.

    return    @compile_array(o) unless o.index
    idx:      del o, 'index'
    step:     del o, 'step'
    vars:     "$idx = ${@from_var.compile(o)}"
    step:     if step then step.compile(o) else '1'
    equals:   if @exclusive then '' else '='
    op:       if starts(step, '-') then ">$equals" else "<$equals"
    "$vars; ${idx} $op ${@to_var.compile(o)}; $idx += $step"

  # When used as a value, expand the range into the equivalent array.
  compile_array: (o) ->
    idt:    @idt 1
    vars:   @compile_variables(merge(o, {indent: idt}))
    equals: if @exclusive then '' else '='
    from:   @from_var.compile o
    to:     @to_var.compile o
    clause: "$from <= $to ?"
    pre:    "\n${idt}a = [];${vars}"
    body:   "var i = $from; ($clause i <$equals $to : i >$equals $to); ($clause i += 1 : i -= 1)"
    post:   "a.push(i);\n${idt}return a;\n$o.indent"
    "(function(){${pre}for ($body) $post}).call(this)"

#### SliceNode

