     @condition = if options?.invert then condition.invert() else condition
     @guard     = options?.guard
 
-  addBody: (body) ->
-    @body = body
+  addBody: (@body) ->
     this
 
   makeReturn: ->
     @returns = true
     this
+
+  containsPureStatement: ->
+    {expressions} = @body
+    i = expressions.length
+    return true if expressions[--i]?.containsPureStatement()
+    ret = (node) -> node instanceof Return
+    return true while i-- when expressions[i].contains ret
+    false
 
   # The main difference from a JavaScript *while* is that the CoffeeScript
   # *while* can be used as a part of a larger expression -- while loops may

  # some cannot.
  compileNode: (o) ->
    {scope} = o
    name    = not @pattern and @name?.compile o
    index   = @index?.compile o
    ivar    = if not index then scope.freeVariable 'i' else index
    varPart = guardPart = defPart = retPart = ''
    body    = Expressions.wrap [@body]
    idt     = @idt 1
    scope.find(name,  immediate: yes) if name
    scope.find(index, immediate: yes) if index

  # Convenience for the most common use of contains. Does the node contain
  # a pure statement?
  containsPureStatement: ->
    @isPureStatement() or @contains (node) -> node.isPureStatement()

  # `toString` representation of the node, for inspecting the parse tree.
  # This is what `coffee --nodes` prints out.
