 # *If/else* statements. Acts as an expression by pushing down requested returns
 # to the last line of each clause.
 #
-# Single-expression **IfNodes** are compiled into ternary operators if possible,
+# Single-expression **IfNodes** are compiled into conditional operators if possible,
 # because ternaries are already proper expressions, and don't need conversion.
 exports.IfNode = class IfNode extends BaseNode
 


  # Is this node of a certain type, or does it contain the type?
  containsType: (type) ->
    this instanceof type or @contains (n) -> n instanceof type

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

  # Perform an in-order traversal of the AST. Crosses scope boundaries.
  traverse: (block) -> @traverseChildren true, block

        fun += name.compile o if name
      return "#{fun}.apply(#{ref}, #{splatargs})"
    call = 'call(this)'
    argvar = (node) -> node instanceof LiteralNode and node.value is 'arguments'
    for arg in @args when arg.contains argvar
      call = 'apply(this, arguments)'
      break
    ctor   = o.scope.freeVariable 'ctor'
    ref    = o.scope.freeVariable 'ref'
    result = o.scope.freeVariable 'result'
    """
    (function() {
    #{idt = @idt 1}var ctor = function() {};
    #{idt}#{utility 'extends'}(ctor, #{ctor} = #{ @variable.compile o });
    #{idt}return typeof (#{result} = #{ctor}.apply(#{ref} = new ctor, #{splatargs})) === "object" ? #{result} : #{ref};
    #{@tab}}).#{call}
    """

