         @tag = new_tag
         @$tag = sync_tag
 
-    write: (data) =>
-        @emit 'data', data
-
     end: () =>
         if @pending.length
             @closed = 'pending'

    opts ?= {}
    return [name, attrs, children, opts]

flush = ->
    if @buffer.length
        @write data for data in @buffer
        @buffer = []

add_tag = (newtag, callback) ->
    return callback?.call(this) unless newtag?

                @closed = 'approving'
                close_tag = =>
                    if @isempty
                        @closed = 'self'
                    else
                        @closed = yes
                    @emit 'close', this
                    @emit 'end'
                    @writable = false
