         return unless el.isempty
         console.warn "attributes of #{el.toString()} don't change anymore"
 
-    onend: (r = 0) ->
+    onend: () ->
         @stream.emit 'end'
 
 

class Entry
    constructor: (el, @parent) ->
        @order = new OrderedEmitter span:yes
        @released = no
        @isnext = no
        @children = 0 # we start with 1 to use 0 as pause bit
        @order.on('entry', ({job}) -> job?())
        @parent?._stream.write =>
            @release() if @children
            @isnext = yes
        @idx = @parent?._stream.children ? -1
        @parent?._stream.children++ # placeholder for close
        el.once 'ready', =>
            @parent?._stream.order.emit('close', order:@idx+1)

    write: (job) ->
        @release() if @children and @isnext
        @order.emit 'entry', {job, order:(++@children)}


        el._stream.write =>
            unless el.closed is 'self'
                @write prettify el, "</#{el.name}>"
            # call next callback of the registered 'ready' checker
            el._stream_ready?()
            el._stream_ready = yes

