     if isValue = @isValue()
       return @compilePatternMatch(o) if @variable.isArray() or @variable.isObject()
       return @compileSplice(o) if @variable.isSplice()
-      return node.compile o if node = Value.unfoldSoak o, this, 'variable'
+      if ifn = Value.unfoldSoak o, this, 'variable'
+        delete o.top
+        return ifn.compile o
     top    = del o, 'top'
     stmt   = del o, 'asStatement'
     name   = @variable.compile(o)

    condO    = merge o
    o.indent = @idt 1
    o.top    = true
    ifDent   = if child or (top and not @isStatement(o)) then '' else @idt()
    comDent  = if child then @idt() else ''
    body     = @body.compile(o)
    ifPart   = "#{ifDent}if (#{ @compileCondition(condO) }) {\n#{body}\n#{@tab}}"
    return ifPart unless @elseBody
    elsePart = if @isChain
      ' else ' + @elseBodyNode().compile(merge(o, {indent: @idt(), chainChild: true}))
    else
      " else {\n#{ @elseBody.compile(o) }\n#{@tab}}"
    "#{ifPart}#{elsePart}"

  # Compile the If as a conditional operator.
  compileExpression: (o) ->

  elseBodyNode: -> @elseBody?.unwrap()

  # Rewrite a chain of **Ifs** to add a default case as the final *else*.
  addElse: (elseBody) ->
    if @isChain
      @elseBodyNode().addElse elseBody
    else
      @isChain  = elseBody instanceof If
      @elseBody = @ensureExpressions elseBody
    this

  # The **If** only compiles into a statement if either of its bodies needs
  # to be a statement. Otherwise a conditional operator is safe.
  isStatement: (o) ->
    @statement or= o?.top or @bodyNode().isStatement(o) or @elseBodyNode()?.isStatement(o)

  compileCondition: (o) ->
    @condition.parenthetical = yes
    @condition.compile o

  compileNode: (o) ->
    if @isStatement o then @compileStatement o else @compileExpression o
