       unless @object
         lvar      = scope.freeVariable 'len'
         stepPart  = if @step then "#{ivar} += #{ @step.compile(o) }" else "#{ivar}++"
-        forPart   = "#{ivar} = 0, #{lvar} = #{svar}.length; #{ivar} < #{lvar}; #{stepPart}"
-    sourcePart    = (if rvar then "#{rvar} = []; " else '') + sourcePart
-    sourcePart    = if sourcePart then "#{@tab}#{sourcePart}\n#{@tab}" else @tab
+        forPart   = "#{ivar} = 0, #{lvar} = #{sourcePart}.length; #{ivar} < #{lvar}; #{stepPart}"
+    resultPart    = if rvar then "#{@tab}#{rvar} = [];\n" else ''
     returnResult  = @compileReturnValue(rvar, o)
     body          = Push.wrap(rvar, body) unless topLevel
     if @guard

    else
      varPart     = "#{idt1}#{namePart};\n" if namePart
    if @object
      forPart     = "#{ivar} in #{svar}"
      guardPart   = "\n#{idt1}if (!#{utility('hasProp')}.call(#{svar}, #{ivar})) continue;" unless @raw
    body          = body.compile merge o, indent: idt1, top: true
    vars          = if range then name else "#{name}, #{ivar}"
    """
    #{sourcePart}for (#{forPart}) {#{guardPart}
    #{varPart}#{body}
    #{@tab}}#{returnResult}
    """

    parts = []
    parts.push @from if @from isnt @fromVar
    parts.push @to if @to isnt @toVar

  # When compiled normally, the range returns the contents of the *for loop*
  # needed to iterate over the values in the range. Used by comprehensions.
  compileNode: (o) ->
    @compileVariables o
    return    @compileArray(o)  unless o.index
    return    @compileSimple(o) if @fromNum and @toNum
    idx      = del o, 'index'
    step     = del o, 'step'
    vars     = "#{idx} = #{@from}" + if @to isnt @toVar then ", #{@to}" else ''
    intro    = "(#{@fromVar} <= #{@toVar} ? #{idx}"
    compare  = "#{intro} <#{@equals} #{@toVar} : #{idx} >#{@equals} #{@toVar})"
    stepPart = if step then step.compile(o) else '1'
