       node.error "multiple parameters named '#{name}'" if name in uniqs
       uniqs.push name
     @body.makeReturn() unless wasEmpty or @noReturn
-    if @bound and o.scope.parent.method?.bound
-      @bound = @context = o.scope.parent.method.context
-    idt   = o.indent
     code  = 'function'
     code  += ' ' + @name if @ctor
     code  += '('

    @params  = params or []
    @body    = body or new Block
    @bound   = tag is 'boundfunc'
    @context = '_this' if @bound

  children: ['params', 'body']


  # a closure.
  compileNode: (o) ->

    if @bound and o.scope.method?.bound
      @context = o.scope.method.context

    # Handle bound functions early.
    if @bound and not @context
      @context = '_this'
      wrapper = new Code [new Param new Literal @context], new Block [this]
      boundfunc = new Call(wrapper, [new Literal 'this'])
      boundfunc.updateLocationDataIfMissing @locationData
      return boundfunc.compileNode(o)
